Package org.camunda.bpm.model.cmmn
Class Cmmn
- java.lang.Object
-
- org.camunda.bpm.model.cmmn.Cmmn
-
public class Cmmn extends java.lang.Object
- Author:
- Roman Smirnov
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Cmmn()
Register known types of the Cmmn model
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
convertToString(CmmnModelInstance modelInstance)
Allows the conversion of aCmmnModelInstance
to anString
.static CmmnModelInstance
createEmptyModel()
Allows creating an new, emptyCmmnModelInstance
.protected java.lang.String
doConvertToString(CmmnModelInstance modelInstance)
protected CmmnModelInstance
doCreateEmptyModel()
protected CmmnModelInstance
doReadModelFromFile(java.io.File file)
protected CmmnModelInstance
doReadModelFromInputStream(java.io.InputStream is)
protected void
doRegisterTypes(ModelBuilder modelBuilder)
protected void
doValidateModel(CmmnModelInstance modelInstance)
protected void
doWriteModelToFile(java.io.File file, CmmnModelInstance modelInstance)
protected void
doWriteModelToOutputStream(java.io.OutputStream os, CmmnModelInstance modelInstance)
Model
getCmmnModel()
ModelBuilder
getCmmnModelBuilder()
static CmmnModelInstance
readModelFromFile(java.io.File file)
Allows reading aCmmnModelInstance
from a File.static CmmnModelInstance
readModelFromStream(java.io.InputStream stream)
Allows reading aCmmnModelInstance
from anInputStream
void
setCmmnModel(Model cmmnModel)
static void
validateModel(CmmnModelInstance modelInstance)
Validate model DOM documentstatic void
writeModelToFile(java.io.File file, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstance
to a File.static void
writeModelToStream(java.io.OutputStream stream, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstance
to anOutputStream
.
-
-
-
Field Detail
-
INSTANCE
public static Cmmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static CmmnModelInstance readModelFromFile(java.io.File file)
Allows reading aCmmnModelInstance
from a File.- Parameters:
file
- theFile
to read theCmmnModelInstance
from- Returns:
- the model read
- Throws:
CmmnModelException
- if the model cannot be read
-
readModelFromStream
public static CmmnModelInstance readModelFromStream(java.io.InputStream stream)
Allows reading aCmmnModelInstance
from anInputStream
- Parameters:
stream
- theInputStream
to read theCmmnModelInstance
from- Returns:
- the model read
- Throws:
ModelParseException
- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(java.io.File file, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstance
to a File. It will be validated before writing.- Parameters:
file
- theFile
to write theCmmnModelInstance
tomodelInstance
- theCmmnModelInstance
to write- Throws:
CmmnModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(java.io.OutputStream stream, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstance
to anOutputStream
. It will be validated before writing.- Parameters:
stream
- theOutputStream
to write theCmmnModelInstance
tomodelInstance
- theCmmnModelInstance
to write- Throws:
ModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
convertToString
public static java.lang.String convertToString(CmmnModelInstance modelInstance)
Allows the conversion of aCmmnModelInstance
to anString
. It will be validated before conversion.- Parameters:
modelInstance
- the model instance to convert- Returns:
- the XML string representation of the model instance
-
validateModel
public static void validateModel(CmmnModelInstance modelInstance)
Validate model DOM document- Parameters:
modelInstance
- theCmmnModelInstance
to validate- Throws:
ModelValidationException
- if the model is not valid
-
createEmptyModel
public static CmmnModelInstance createEmptyModel()
Allows creating an new, emptyCmmnModelInstance
.- Returns:
- the empty model.
-
doReadModelFromFile
protected CmmnModelInstance doReadModelFromFile(java.io.File file)
-
doReadModelFromInputStream
protected CmmnModelInstance doReadModelFromInputStream(java.io.InputStream is)
-
doWriteModelToFile
protected void doWriteModelToFile(java.io.File file, CmmnModelInstance modelInstance)
-
doWriteModelToOutputStream
protected void doWriteModelToOutputStream(java.io.OutputStream os, CmmnModelInstance modelInstance)
-
doConvertToString
protected java.lang.String doConvertToString(CmmnModelInstance modelInstance)
-
doValidateModel
protected void doValidateModel(CmmnModelInstance modelInstance)
-
doCreateEmptyModel
protected CmmnModelInstance doCreateEmptyModel()
-
doRegisterTypes
protected void doRegisterTypes(ModelBuilder modelBuilder)
-
getCmmnModelBuilder
public ModelBuilder getCmmnModelBuilder()
-
setCmmnModel
public void setCmmnModel(Model cmmnModel)
- Parameters:
cmmnModel
- the cmmnModel to set
-
-