Package org.camunda.bpm.model.bpmn
Class Bpmn
java.lang.Object
org.camunda.bpm.model.bpmn.Bpmn
Provides access to the camunda BPMN model api.
- Author:
- Daniel Meyer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertToString
(BpmnModelInstance modelInstance) Allows the conversion of aBpmnModelInstance
to anString
.static BpmnModelInstance
Allows creating an new, emptyBpmnModelInstance
.static ProcessBuilder
static ProcessBuilder
createExecutableProcess
(String processId) static ProcessBuilder
static ProcessBuilder
createProcess
(String processId) protected String
doConvertToString
(BpmnModelInstance modelInstance) protected BpmnModelInstance
protected BpmnModelInstance
doReadModelFromFile
(File file) protected BpmnModelInstance
protected void
doRegisterTypes
(ModelBuilder bpmnModelBuilder) protected void
doValidateModel
(BpmnModelInstance modelInstance) protected void
doWriteModelToFile
(File file, BpmnModelInstance modelInstance) protected void
doWriteModelToOutputStream
(OutputStream os, BpmnModelInstance modelInstance) static BpmnModelInstance
readModelFromFile
(File file) Allows reading aBpmnModelInstance
from a File.static BpmnModelInstance
readModelFromStream
(InputStream stream) Allows reading aBpmnModelInstance
from anInputStream
void
setBpmnModel
(Model bpmnModel) static void
validateModel
(BpmnModelInstance modelInstance) Validate model DOM documentstatic void
writeModelToFile
(File file, BpmnModelInstance modelInstance) Allows writing aBpmnModelInstance
to a File.static void
writeModelToStream
(OutputStream stream, BpmnModelInstance modelInstance) Allows writing aBpmnModelInstance
to anOutputStream
.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Bpmn
protected Bpmn()Register known types of the BPMN model
-
-
Method Details
-
readModelFromFile
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
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
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
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
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
Validate model DOM document- Parameters:
modelInstance
- theBpmnModelInstance
to validate- Throws:
ModelValidationException
- if the model is not valid
-
createEmptyModel
Allows creating an new, emptyBpmnModelInstance
.- Returns:
- the empty model.
-
createProcess
-
createProcess
-
createExecutableProcess
-
createExecutableProcess
-
doReadModelFromFile
-
doReadModelFromInputStream
-
doWriteModelToFile
-
doWriteModelToOutputStream
-
doConvertToString
-
doValidateModel
-
doCreateEmptyModel
-
doRegisterTypes
-
getBpmnModel
- Returns:
- the
Model
instance to use
-
getBpmnModelBuilder
-
setBpmnModel
- Parameters:
bpmnModel
- the bpmnModel to set
-