Sequence Flows
Sequence flow is a BPMN element that represents the order in which activities are performed within a business process. It defines the logical flow of work or information from one activity to another, indicating the sequence in which tasks or subprocesses should be executed.
Sequence flows connect two activities in a BPMN diagram, showing the direction in which the process flows and the dependencies between activities. They play a crucial role in visualizing and modeling the flow of work within a business process, helping to ensure clarity and consistency in process design.
Graphical and XML Representation
A sequence flow is visualized as an arrow going from the source element towards the target element. The arrow always points towards the target.
In the XML file sequence flows are represented as separate objects among other BPMN elements:
<sequenceFlow id="Flow_1sjggq6" sourceRef="Event_15w11z6" targetRef="Gateway_0r2ejfv" />
You can see two XML attributes in the sequence flow description: sourceRef and targetRef that are referencing elements where the arrow begins and ends.
Incoming and Outgoing Flows
As a sequence flow connects two activities, for the first one it is outgoing and for the second one — incoming flow.
Best practice is to have the only one incoming and the only one outgoing flow for each activity.
In the XML file you can see references to sequence flows in the corresponding BPMN element description:
<task id="Activity_1pncn0v" name="Activity">
<incoming>Flow_1tncfsd</incoming>
<outgoing>Flow_1nxsuoi</outgoing>
</task>
Sequence Flow Properties
Sequence flows have general properties:
-
Id
-
Name
And a Condition property. (See the purpose and usage details of condition property in the Exclusive gateway section.)
Conditional Sequence Flow
BPMN 2.0 defines a conditional flow as a special element of notation. Graphically, it is represented as a regular sequence flow with a mini-diamond at the beginning of the connector line, see below:
Conditional flow can be used only as outgoing flow for activity. The condition must be evaluated at runtime to determine whether the sequence flow will be used or not.
In Jmix BPM all sequence flows may have a condition, but it will be evaluated and used only when required.
It is highly not recommended to use conditional flows because of the risk of errors. For example, in the picture above, the process will stop if the condition is false and no other paths are available. |
Default Sequence Flow
All BPMN 2.0 tasks and gateways can have a default sequence flow. This sequence flow is only selected as the outgoing sequence flow for activity or gateway.
A default sequence flow is visualized as a regular sequence flow, with a 'slash' marker at the beginning.
Default flow’s behavior depends on the element it is used with. Conditions on a default sequence flow are always ignored.
Using Conditional and Default Sequence Flows
Though BPMN specification allows using conditional and default flows as in the picture below, avoid using them such way. It makes the diagram worse readable and ambiguous.
Instead of conditional and default flows, outgoing from the activity, better use gateway:
In this example, you can see an exclusive gateway, parallel and inclusive gateways are also possible.