Package org.camunda.bpm.model.bpmn
Class Bpmn
- java.lang.Object
-
- org.camunda.bpm.model.bpmn.Bpmn
-
public class Bpmn extends java.lang.ObjectProvides access to the camunda BPMN model api.
- Author:
- Daniel Meyer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBpmn()Register known types of the BPMN model
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringconvertToString(BpmnModelInstance modelInstance)Allows the conversion of aBpmnModelInstanceto anString.static BpmnModelInstancecreateEmptyModel()Allows creating an new, emptyBpmnModelInstance.static ProcessBuildercreateExecutableProcess()static ProcessBuildercreateExecutableProcess(java.lang.String processId)static ProcessBuildercreateProcess()static ProcessBuildercreateProcess(java.lang.String processId)protected java.lang.StringdoConvertToString(BpmnModelInstance modelInstance)protected BpmnModelInstancedoCreateEmptyModel()protected BpmnModelInstancedoReadModelFromFile(java.io.File file)protected BpmnModelInstancedoReadModelFromInputStream(java.io.InputStream is)protected voiddoRegisterTypes(ModelBuilder bpmnModelBuilder)protected voiddoValidateModel(BpmnModelInstance modelInstance)protected voiddoWriteModelToFile(java.io.File file, BpmnModelInstance modelInstance)protected voiddoWriteModelToOutputStream(java.io.OutputStream os, BpmnModelInstance modelInstance)ModelgetBpmnModel()ModelBuildergetBpmnModelBuilder()static BpmnModelInstancereadModelFromFile(java.io.File file)Allows reading aBpmnModelInstancefrom a File.static BpmnModelInstancereadModelFromStream(java.io.InputStream stream)Allows reading aBpmnModelInstancefrom anInputStreamvoidsetBpmnModel(Model bpmnModel)static voidvalidateModel(BpmnModelInstance modelInstance)Validate model DOM documentstatic voidwriteModelToFile(java.io.File file, BpmnModelInstance modelInstance)Allows writing aBpmnModelInstanceto a File.static voidwriteModelToStream(java.io.OutputStream stream, BpmnModelInstance modelInstance)Allows writing aBpmnModelInstanceto anOutputStream.
-
-
-
Field Detail
-
INSTANCE
public static Bpmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static BpmnModelInstance readModelFromFile(java.io.File file)
Allows reading aBpmnModelInstancefrom a File.- Parameters:
file- theFileto read theBpmnModelInstancefrom- Returns:
- the model read
- Throws:
BpmnModelException- if the model cannot be read
-
readModelFromStream
public static BpmnModelInstance readModelFromStream(java.io.InputStream stream)
Allows reading aBpmnModelInstancefrom anInputStream- Parameters:
stream- theInputStreamto read theBpmnModelInstancefrom- Returns:
- the model read
- Throws:
ModelParseException- if the model cannot be read
-
writeModelToFile
public static void writeModelToFile(java.io.File file, BpmnModelInstance modelInstance)Allows writing aBpmnModelInstanceto a File. It will be validated before writing.- Parameters:
file- theFileto write theBpmnModelInstancetomodelInstance- theBpmnModelInstanceto write- Throws:
BpmnModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
writeModelToStream
public static void writeModelToStream(java.io.OutputStream stream, BpmnModelInstance modelInstance)Allows writing aBpmnModelInstanceto anOutputStream. It will be validated before writing.- Parameters:
stream- theOutputStreamto write theBpmnModelInstancetomodelInstance- theBpmnModelInstanceto write- Throws:
ModelException- if the model cannot be writtenModelValidationException- if the model is not valid
-
convertToString
public static java.lang.String convertToString(BpmnModelInstance modelInstance)
Allows the conversion of aBpmnModelInstanceto 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- theBpmnModelInstanceto 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(java.lang.String processId)
-
createExecutableProcess
public static ProcessBuilder createExecutableProcess()
-
createExecutableProcess
public static ProcessBuilder createExecutableProcess(java.lang.String processId)
-
doReadModelFromFile
protected BpmnModelInstance doReadModelFromFile(java.io.File file)
-
doReadModelFromInputStream
protected BpmnModelInstance doReadModelFromInputStream(java.io.InputStream is)
-
doWriteModelToFile
protected void doWriteModelToFile(java.io.File file, BpmnModelInstance modelInstance)
-
doWriteModelToOutputStream
protected void doWriteModelToOutputStream(java.io.OutputStream os, BpmnModelInstance modelInstance)
-
doConvertToString
protected java.lang.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
-
-