Package org.camunda.bpm.model.cmmn
Class Cmmn
java.lang.Object
org.camunda.bpm.model.cmmn.Cmmn
- Author:
- Roman Smirnov
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertToString
(CmmnModelInstance modelInstance) Allows the conversion of aCmmnModelInstance
to anString
.static CmmnModelInstance
Allows creating an new, emptyCmmnModelInstance
.protected String
doConvertToString
(CmmnModelInstance modelInstance) protected CmmnModelInstance
protected CmmnModelInstance
doReadModelFromFile
(File file) protected CmmnModelInstance
protected void
doRegisterTypes
(ModelBuilder modelBuilder) protected void
doValidateModel
(CmmnModelInstance modelInstance) protected void
doWriteModelToFile
(File file, CmmnModelInstance modelInstance) protected void
doWriteModelToOutputStream
(OutputStream os, CmmnModelInstance modelInstance) static CmmnModelInstance
readModelFromFile
(File file) Allows reading aCmmnModelInstance
from a File.static CmmnModelInstance
readModelFromStream
(InputStream stream) Allows reading aCmmnModelInstance
from anInputStream
void
setCmmnModel
(Model cmmnModel) static void
validateModel
(CmmnModelInstance modelInstance) Validate model DOM documentstatic void
writeModelToFile
(File file, CmmnModelInstance modelInstance) Allows writing aCmmnModelInstance
to a File.static void
writeModelToStream
(OutputStream stream, CmmnModelInstance modelInstance) Allows writing aCmmnModelInstance
to anOutputStream
.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Cmmn
protected Cmmn()Register known types of the Cmmn model
-
-
Method Details
-
readModelFromFile
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
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
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
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
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
Validate model DOM document- Parameters:
modelInstance
- theCmmnModelInstance
to validate- Throws:
ModelValidationException
- if the model is not valid
-
createEmptyModel
Allows creating an new, emptyCmmnModelInstance
.- Returns:
- the empty model.
-
doReadModelFromFile
-
doReadModelFromInputStream
-
doWriteModelToFile
-
doWriteModelToOutputStream
-
doConvertToString
-
doValidateModel
-
doCreateEmptyModel
-
doRegisterTypes
-
getCmmnModel
- Returns:
- the
Model
instance to use
-
getCmmnModelBuilder
-
setCmmnModel
- Parameters:
cmmnModel
- the cmmnModel to set
-