BPMN Model API
Read a Model
If you already created a BPMN model and want to process it through the BPMN model API, you can import it with the following methods.
If you already created a BPMN model and want to process it through the BPMN model API, you can import it with the
following methods.
After you imported your model you can search for elements by their id or by the type of element.
For every element instance you can now read and edit the attribute values. You can do this by either using the provided
helper methods or the generic XML model API. If you added custom attributes to the BPMN elements, you can
always access them with the generic XML model API.
You can also access the child elements of an element or references to other elements. For example, a sequence flow
references a source and a target element while a flow node (like start event, tasks, etc.) has child elements
for incoming and outgoing sequence flows.
For example, the following BPMN model was created by the BPMN model API as an example for a simple process.
You can now use the BPMN model API to get the source and target flow node of the sequence flow with the ID start-task1.
With these references you can easily create helper methods for different use cases. For example, if you want to
find the following flow nodes of a task or a gateway you can use a helper method like the following.