Class Cmmn

java.lang.Object
org.camunda.bpm.model.cmmn.Cmmn

public class Cmmn extends Object
Author:
Roman Smirnov
  • Field Details

    • INSTANCE

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

    • Cmmn

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

    • readModelFromFile

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

      public static CmmnModelInstance readModelFromStream(InputStream stream)
      Allows reading a CmmnModelInstance from an InputStream
      Parameters:
      stream - the InputStream to read the CmmnModelInstance 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, CmmnModelInstance modelInstance)
      Allows writing a CmmnModelInstance to a File. It will be validated before writing.
      Parameters:
      file - the File to write the CmmnModelInstance to
      modelInstance - the CmmnModelInstance to write
      Throws:
      CmmnModelException - 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, CmmnModelInstance modelInstance)
      Allows writing a CmmnModelInstance to an OutputStream. It will be validated before writing.
      Parameters:
      stream - the OutputStream to write the CmmnModelInstance to
      modelInstance - the CmmnModelInstance 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(CmmnModelInstance modelInstance)
      Allows the conversion of a CmmnModelInstance 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(CmmnModelInstance modelInstance)
      Validate model DOM document
      Parameters:
      modelInstance - the CmmnModelInstance to validate
      Throws:
      org.camunda.bpm.model.xml.ModelValidationException - if the model is not valid
    • createEmptyModel

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

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

      public org.camunda.bpm.model.xml.ModelBuilder getCmmnModelBuilder()
    • setCmmnModel

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