Package org.camunda.bpm.model.bpmn
Class Bpmn
- java.lang.Object
-
- org.camunda.bpm.model.bpmn.Bpmn
-
public class Bpmn extends Object
Provides access to the camunda BPMN model api.
- Author:
- Daniel Meyer
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Bpmn()
Register known types of the BPMN model
-
Method Summary
-
-
-
Field Detail
-
INSTANCE
public static Bpmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static BpmnModelInstance readModelFromFile(File file)
Allows reading aBpmnModelInstance
from a File.- Parameters:
file
- theFile
to read theBpmnModelInstance
from- Returns:
- the model read
- Throws:
BpmnModelException
- if the model cannot be read
-
readModelFromStream
public static BpmnModelInstance readModelFromStream(InputStream stream)
Allows reading aBpmnModelInstance
from anInputStream
- Parameters:
stream
- theInputStream
to read theBpmnModelInstance
from- Returns:
- the model read
- Throws:
ModelParseException
- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(File file, BpmnModelInstance modelInstance)
Allows writing aBpmnModelInstance
to a File. It will be validated before writing.- Parameters:
file
- theFile
to write theBpmnModelInstance
tomodelInstance
- theBpmnModelInstance
to write- Throws:
BpmnModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(OutputStream stream, BpmnModelInstance modelInstance)
Allows writing aBpmnModelInstance
to anOutputStream
. It will be validated before writing.- Parameters:
stream
- theOutputStream
to write theBpmnModelInstance
tomodelInstance
- theBpmnModelInstance
to write- Throws:
ModelException
- if the model cannot be writtenModelValidationException
- if the model is not valid
-
convertToString
public static String convertToString(BpmnModelInstance modelInstance)
Allows the conversion of aBpmnModelInstance
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(BpmnModelInstance modelInstance)
Validate model DOM document- Parameters:
modelInstance
- theBpmnModelInstance
to validate- Throws:
ModelValidationException
- if the model is not valid
-
createEmptyModel
public static BpmnModelInstance createEmptyModel()
Allows creating an new, emptyBpmnModelInstance
.- 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(ModelBuilder bpmnModelBuilder)
-
getBpmnModelBuilder
public ModelBuilder getBpmnModelBuilder()
-
setBpmnModel
public void setBpmnModel(Model bpmnModel)
- Parameters:
bpmnModel
- the bpmnModel to set
-
-