Class Dmn

java.lang.Object
org.camunda.bpm.model.dmn.Dmn

public class Dmn extends Object
  • Field Details

    • INSTANCE

      public static Dmn INSTANCE
      the singleton instance of Dmn. If you want to customize the behavior of Dmn, replace this instance with an instance of a custom subclass of Dmn.
  • Constructor Details

    • Dmn

      protected Dmn()
      Register known types of the Dmn model
  • Method Details

    • readModelFromFile

      public static DmnModelInstance readModelFromFile(File file)
      Allows reading a DmnModelInstance from a File.
      Parameters:
      file - the File to read the DmnModelInstance from
      Returns:
      the model read
      Throws:
      DmnModelException - if the model cannot be read
    • readModelFromStream

      public static DmnModelInstance readModelFromStream(InputStream stream)
      Allows reading a DmnModelInstance from an InputStream
      Parameters:
      stream - the InputStream to read the DmnModelInstance from
      Returns:
      the model read
      Throws:
      org.camunda.bpm.model.xml.ModelParseException - if the model cannot be read
    • writeModelToFile

      public static void writeModelToFile(File file, DmnModelInstance modelInstance)
      Allows writing a DmnModelInstance to a File. It will be validated before writing.
      Parameters:
      file - the File to write the DmnModelInstance to
      modelInstance - the DmnModelInstance to write
      Throws:
      DmnModelException - if the model cannot be written
      org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid
    • writeModelToStream

      public static void writeModelToStream(OutputStream stream, DmnModelInstance modelInstance)
      Allows writing a DmnModelInstance to an OutputStream. It will be validated before writing.
      Parameters:
      stream - the OutputStream to write the DmnModelInstance to
      modelInstance - the DmnModelInstance to write
      Throws:
      org.camunda.bpm.model.xml.ModelException - if the model cannot be written
      org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid
    • convertToString

      public static String convertToString(DmnModelInstance modelInstance)
      Allows the conversion of a DmnModelInstance to an String. 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 - the DmnModelInstance to validate
      Throws:
      org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid
    • createEmptyModel

      public static DmnModelInstance createEmptyModel()
      Allows creating an new, empty DmnModelInstance.
      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(org.camunda.bpm.model.xml.ModelBuilder modelBuilder)
    • getDmnModel

      public org.camunda.bpm.model.xml.Model getDmnModel()
      Returns:
      the Model instance to use
    • getDmnModelBuilder

      public org.camunda.bpm.model.xml.ModelBuilder getDmnModelBuilder()
    • setDmnModel

      public void setDmnModel(org.camunda.bpm.model.xml.Model dmnModel)
      Parameters:
      dmnModel - the cmmnModel to set