org.camunda.bpm.model.bpmn
Class Bpmn

java.lang.Object
  extended by org.camunda.bpm.model.bpmn.Bpmn

public class Bpmn
extends Object

Provides access to the camunda BPMN model api.

Author:
Daniel Meyer

Field Summary
static Bpmn INSTANCE
          the singleton instance of Bpmn.
 
Constructor Summary
protected Bpmn()
          Register known types of the BPMN model
 
Method Summary
static String convertToString(BpmnModelInstance modelInstance)
          Allows the conversion of a BpmnModelInstance to an String.
static BpmnModelInstance createEmptyModel()
          Allows creating an new, empty BpmnModelInstance.
static ProcessBuilder createExecutableProcess()
           
static ProcessBuilder createExecutableProcess(String processId)
           
static ProcessBuilder createProcess()
           
static ProcessBuilder createProcess(String processId)
           
protected  String doConvertToString(BpmnModelInstance modelInstance)
           
protected  BpmnModelInstance doCreateEmptyModel()
           
protected  BpmnModelInstance doReadModelFromFile(File file)
           
protected  BpmnModelInstance doReadModelFromInputStream(InputStream is)
           
protected  void doRegisterTypes(org.camunda.bpm.model.xml.ModelBuilder bpmnModelBuilder)
           
protected  void doValidateModel(BpmnModelInstance modelInstance)
           
protected  void doWriteModelToFile(File file, BpmnModelInstance modelInstance)
           
protected  void doWriteModelToOutputStream(OutputStream os, BpmnModelInstance modelInstance)
           
 org.camunda.bpm.model.xml.Model getBpmnModel()
           
 org.camunda.bpm.model.xml.ModelBuilder getBpmnModelBuilder()
           
static BpmnModelInstance readModelFromFile(File file)
          Allows reading a BpmnModelInstance from a File.
static BpmnModelInstance readModelFromStream(InputStream stream)
          Allows reading a BpmnModelInstance from an InputStream
 void setBpmnModel(org.camunda.bpm.model.xml.Model bpmnModel)
           
static void validateModel(BpmnModelInstance modelInstance)
          Validate model DOM document
static void writeModelToFile(File file, BpmnModelInstance modelInstance)
          Allows writing a BpmnModelInstance to a File.
static void writeModelToStream(OutputStream stream, BpmnModelInstance modelInstance)
          Allows writing a BpmnModelInstance to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

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

Constructor Detail

Bpmn

protected Bpmn()
Register known types of the BPMN model

Method Detail

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

getBpmnModelBuilder

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

setBpmnModel

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


Copyright © 2017 camunda services GmbH. All rights reserved.