Package org.camunda.bpm.model.cmmn
Class Cmmn
- java.lang.Object
-
- org.camunda.bpm.model.cmmn.Cmmn
-
public class Cmmn extends Object
- Author:
- Roman Smirnov
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCmmn()Register known types of the Cmmn model
-
Method Summary
-
-
-
Field Detail
-
INSTANCE
public static Cmmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static CmmnModelInstance readModelFromFile(File file)
Allows reading aCmmnModelInstancefrom a File.- Parameters:
file- theFileto read theCmmnModelInstancefrom- Returns:
- the model read
- Throws:
CmmnModelException- if the model cannot be read
-
readModelFromStream
public static CmmnModelInstance readModelFromStream(InputStream stream)
Allows reading aCmmnModelInstancefrom anInputStream- Parameters:
stream- theInputStreamto read theCmmnModelInstancefrom- Returns:
- the model read
- Throws:
ModelParseException- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(File file, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstanceto a File. It will be validated before writing.- Parameters:
file- theFileto write theCmmnModelInstancetomodelInstance- theCmmnModelInstanceto write- Throws:
CmmnModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(OutputStream stream, CmmnModelInstance modelInstance)
Allows writing aCmmnModelInstanceto anOutputStream. It will be validated before writing.- Parameters:
stream- theOutputStreamto write theCmmnModelInstancetomodelInstance- theCmmnModelInstanceto write- Throws:
ModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
convertToString
public static String convertToString(CmmnModelInstance modelInstance)
Allows the conversion of aCmmnModelInstanceto 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- theCmmnModelInstanceto 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(File file)
-
doReadModelFromInputStream
protected CmmnModelInstance doReadModelFromInputStream(InputStream is)
-
doWriteModelToFile
protected void doWriteModelToFile(File file, CmmnModelInstance modelInstance)
-
doWriteModelToOutputStream
protected void doWriteModelToOutputStream(OutputStream os, CmmnModelInstance modelInstance)
-
doConvertToString
protected 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
-
-