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 protected
Dmn()
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 aDmnModelInstance
from a File.- Parameters:
file
- theFile
to read theDmnModelInstance
from- Returns:
- the model read
- Throws:
DmnModelException
- if the model cannot be read
-
readModelFromStream
public static DmnModelInstance readModelFromStream(InputStream stream)
Allows reading aDmnModelInstance
from anInputStream
- Parameters:
stream
- theInputStream
to read theDmnModelInstance
from- Returns:
- the model read
- Throws:
ModelParseException
- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(File file, DmnModelInstance modelInstance)
Allows writing aDmnModelInstance
to a File. It will be validated before writing.- Parameters:
file
- theFile
to write theDmnModelInstance
tomodelInstance
- theDmnModelInstance
to 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 aDmnModelInstance
to anOutputStream
. It will be validated before writing.- Parameters:
stream
- theOutputStream
to write theDmnModelInstance
tomodelInstance
- theDmnModelInstance
to 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 aDmnModelInstance
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(DmnModelInstance modelInstance)
Validate model DOM document- Parameters:
modelInstance
- theDmnModelInstance
to 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
-
-