Package org.camunda.bpm.model.dmn
Class Dmn
- java.lang.Object
-
- org.camunda.bpm.model.dmn.Dmn
-
public class Dmn extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDmn()Register known types of the Dmn model
-
Method Summary
-
-
-
Field Detail
-
INSTANCE
public static Dmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static DmnModelInstance readModelFromFile(File file)
Allows reading aDmnModelInstancefrom a File.- Parameters:
file- theFileto read theDmnModelInstancefrom- Returns:
- the model read
- Throws:
DmnModelException- if the model cannot be read
-
readModelFromStream
public static DmnModelInstance readModelFromStream(InputStream stream)
Allows reading aDmnModelInstancefrom anInputStream- Parameters:
stream- theInputStreamto read theDmnModelInstancefrom- Returns:
- the model read
- Throws:
ModelParseException- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(File file, DmnModelInstance modelInstance)
Allows writing aDmnModelInstanceto a File. It will be validated before writing.- Parameters:
file- theFileto write theDmnModelInstancetomodelInstance- theDmnModelInstanceto write- Throws:
DmnModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(OutputStream stream, DmnModelInstance modelInstance)
Allows writing aDmnModelInstanceto anOutputStream. It will be validated before writing.- Parameters:
stream- theOutputStreamto write theDmnModelInstancetomodelInstance- theDmnModelInstanceto write- Throws:
ModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
convertToString
public static String convertToString(DmnModelInstance modelInstance)
Allows the conversion of aDmnModelInstanceto 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(DmnModelInstance modelInstance)
Validate model DOM document- Parameters:
modelInstance- theDmnModelInstanceto validate- Throws:
ModelValidationException- if the model is not valid
-
createEmptyModel
public static DmnModelInstance createEmptyModel()
Allows creating an new, emptyDmnModelInstance.- Returns:
- the empty model.
-
doReadModelFromFile
protected DmnModelInstance doReadModelFromFile(File file)
-
doReadModelFromInputStream
protected DmnModelInstance doReadModelFromInputStream(InputStream is)
-
doWriteModelToFile
protected void doWriteModelToFile(File file, DmnModelInstance modelInstance)
-
doWriteModelToOutputStream
protected void doWriteModelToOutputStream(OutputStream os, DmnModelInstance modelInstance)
-
doConvertToString
protected String doConvertToString(DmnModelInstance modelInstance)
-
doValidateModel
protected void doValidateModel(DmnModelInstance modelInstance)
-
doCreateEmptyModel
protected DmnModelInstance doCreateEmptyModel()
-
doRegisterTypes
protected void doRegisterTypes(ModelBuilder modelBuilder)
-
getDmnModelBuilder
public ModelBuilder getDmnModelBuilder()
-
setDmnModel
public void setDmnModel(Model dmnModel)
- Parameters:
dmnModel- the cmmnModel to set
-
-