Inclusive gateway
Currently, Camunda 8 only supports the diverging (i.e. splitting, forking) inclusive gateway. It does not yet support the converging (i.e. merging, joining) inclusive gateway. A combination of parallel and exclusive gateways can be used as an alternative way to merge the flows.
The inclusive gateway (or OR-gateway) allows for making multiple decisions based on data (i.e. on process instance variables).
If an inclusive gateway has multiple outgoing sequence flows, all sequence flows must have a condition to define when the flow is taken. If the inclusive gateway only has one outgoing sequence flow, then it does not need to have a condition.
Optionally, one of the sequence flows can be marked as the default flow. This sequence flow should not have a condition, because its behavior depends on the other conditions.
When an inclusive gateway is entered, the conditions are evaluated. The process instance takes all sequence flows where the condition is fulfilled.
For example: Courses selected include pasta
and salad
.
For example: Courses selected include steak
, pasta
and salad
.
If no condition is fulfilled, it takes the default flow of the gateway. Note that the default flow is not expected to have a condition, and is therefore not evaluated. If no condition is fulfilled and the gateway has no default flow, an incident is created.
For example: No courses selected then the default flow is taken.
Conditions​
A conditionExpression
defines when a flow is taken. It is a boolean expression that can access the process instance variables and compare them with literals or other variables. The condition is fulfilled when the expression returns true
.
Multiple boolean values or comparisons can be combined as disjunction (and
) or conjunction (or
).
For example:
= totalPrice > 100
= order.customer = "Paul"
= orderCount > 15 or totalPrice > 50
= valid and orderCount > 0
= list contains(courses, "salad")
Additional resources​
XML representation​
An inclusive gateway with three outgoing sequence flows and the default sequence flow is Salad
:
<bpmn:inclusiveGateway id="Gateway_1dj8ts6" name="Courses selected?" default="Flow_05d0jjq">
<bpmn:incoming>Flow_0mfam08</bpmn:incoming>
<bpmn:outgoing>Flow_0d3xogt</bpmn:outgoing>
<bpmn:outgoing>Flow_1le3l31</bpmn:outgoing>
<bpmn:outgoing>Flow_05d0jjq</bpmn:outgoing>
</bpmn:inclusiveGateway>
<bpmn:sequenceFlow id="Flow_0d3xogt" name="Pasta"
sourceRef="Gateway_1dj8ts6" targetRef="Activity_1orhxob">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
= list contains(courses, "pasta")
</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_1le3l31" name="Steak"
sourceRef="Gateway_1dj8ts6" targetRef="Activity_0rygy6z">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
= list contains(courses, "steak")
</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_05d0jjq" name="Salad"
sourceRef="Gateway_1dj8ts6" targetRef="Activity_06yrt1e" />