Class Bpmn

java.lang.Object
io.camunda.zeebe.model.bpmn.Bpmn
Direct Known Subclasses:
BpmnImpl

public class Bpmn extends Object
Provides access to the camunda BPMN model api.
Author:
Daniel Meyer
  • Field Details

    • INSTANCE

      public static final Bpmn INSTANCE
  • Constructor Details

    • Bpmn

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

    • readModelFromFile

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

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

      public static BpmnModelInstance createEmptyModel()
      Allows creating an new, empty BpmnModelInstance.
      Returns:
      the empty model.
    • createProcess

      public static ProcessBuilder createProcess()
    • createProcess

      public static ProcessBuilder createProcess(String processId)
    • createExecutableProcess

      public static ProcessBuilder createExecutableProcess()
    • createExecutableProcess

      public static ProcessBuilder createExecutableProcess(String processId)
    • doReadModelFromFile

      protected BpmnModelInstance doReadModelFromFile(File file)
    • doReadModelFromInputStream

      protected BpmnModelInstance doReadModelFromInputStream(InputStream is)
    • doWriteModelToFile

      protected void doWriteModelToFile(File file, BpmnModelInstance modelInstance)
    • doWriteModelToOutputStream

      protected void doWriteModelToOutputStream(OutputStream os, BpmnModelInstance modelInstance)
    • doConvertToString

      protected String doConvertToString(BpmnModelInstance modelInstance)
    • doValidateModel

      protected void doValidateModel(BpmnModelInstance modelInstance)
    • doCreateEmptyModel

      protected BpmnModelInstance doCreateEmptyModel()
    • doRegisterTypes

      protected void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder bpmnModelBuilder)
    • getBpmnModel

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

      public void setBpmnModel(org.camunda.bpm.model.xml.Model bpmnModel)
      Parameters:
      bpmnModel - the bpmnModel to set
    • getBpmnModelBuilder

      public org.camunda.bpm.model.xml.ModelBuilder getBpmnModelBuilder()