Package org.camunda.bpm.model.bpmn
Class Bpmn
- java.lang.Object
-
- org.camunda.bpm.model.bpmn.Bpmn
-
public class Bpmn extends java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
convertToString(BpmnModelInstance modelInstance)
Allows the conversion of aBpmnModelInstance
to anString
.static BpmnModelInstance
createEmptyModel()
Allows creating an new, emptyBpmnModelInstance
.static ProcessBuilder
createExecutableProcess()
static ProcessBuilder
createExecutableProcess(java.lang.String processId)
static ProcessBuilder
createProcess()
static ProcessBuilder
createProcess(java.lang.String processId)
protected java.lang.String
doConvertToString(BpmnModelInstance modelInstance)
protected BpmnModelInstance
doCreateEmptyModel()
protected BpmnModelInstance
doReadModelFromFile(java.io.File file)
protected BpmnModelInstance
doReadModelFromInputStream(java.io.InputStream is)
protected void
doRegisterTypes(ModelBuilder bpmnModelBuilder)
protected void
doValidateModel(BpmnModelInstance modelInstance)
protected void
doWriteModelToFile(java.io.File file, BpmnModelInstance modelInstance)
protected void
doWriteModelToOutputStream(java.io.OutputStream os, BpmnModelInstance modelInstance)
Model
getBpmnModel()
ModelBuilder
getBpmnModelBuilder()
static BpmnModelInstance
readModelFromFile(java.io.File file)
Allows reading aBpmnModelInstance
from a File.static BpmnModelInstance
readModelFromStream(java.io.InputStream stream)
Allows reading aBpmnModelInstance
from anInputStream
void
setBpmnModel(Model bpmnModel)
static void
validateModel(BpmnModelInstance modelInstance)
Validate model DOM documentstatic void
writeModelToFile(java.io.File file, BpmnModelInstance modelInstance)
Allows writing aBpmnModelInstance
to a File.static void
writeModelToStream(java.io.OutputStream stream, BpmnModelInstance modelInstance)
Allows writing aBpmnModelInstance
to anOutputStream
.
-
-
-
Field Detail
-
INSTANCE
public static Bpmn INSTANCE
-
-
Method Detail
-
readModelFromFile
public static BpmnModelInstance readModelFromFile(java.io.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(java.io.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(java.io.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(java.io.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 java.lang.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(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
-
-