Are there available functions to capture sequence flow relations? Such as finding the fragments that contain block structures between complementary XOR or AND gateways? There are algorithms and implementations to parse workflows and identify process fragments as a tree but I am not sure if it is practical to integrate them. Any information and ideas are welcome.
We expose the BPMN model as a tree of interconnected elements via the ElementRegistry
, each element identified by its id
(as specified in the BPMN 2.0 XML document).
The data model is pretty simple and contains shapes and connections only:
- shapes have a list of incoming and outgoing connections
- shapes have children
- connections have
source
andtarget
See it as source code.
Underlying each element is the actual BPMN element, referenced through a hidden businessObject
attribute. The BPMN tree can be traversed, too to learn about various kinds of relationships.
So depending on what you need, you may simply traverse the model node for node to figure out the changes.
Example
Looking at the following diagram:
To learn about B
s dependencies:
var b = elementRegistry.get('B');
// incoming / outgoing connections
b.incoming; // [ Connection{ id: '...' } ]
b.outgoing; // [ Connection{ id: '...' } ]
// traversal
b.incoming[0].source; // [ Shape{ id: 'A' } ]
b.outgoing[0].target; // [ Shape{ id: 'C' } ]
// access to BPMN element
b.businessObject; // ModdleElement{ id: 'B', name: 'B', $type: 'bpmn:Task', ... }
1 Like