BPMN Gateways
Gateways are elements that route tokens in more complex patterns than plain sequence flow.
BPMN's exclusive gateway chooses one sequence flow out of many based on data, whereas BPMN's parallel gateway generates new tokens by activating multiple sequence flows in parallel, for example.
Currently supported elements:
Exclusive gateways
An exclusive gateway (or XOR-gateway) allows you to make a decision based on data (i.e. on process instance variables).
If an exclusive gateway has multiple outgoing sequence flows, all sequence flows except one must have a conditionExpression
to define when the flow is taken. The gateway can have one sequence flow without conditionExpression
, which must be defined as the default flow.
When an exclusive gateway is entered, the conditionExpression
is evaluated. The process instance takes the first sequence flow where the condition is fulfilled.
If no condition is fulfilled, it takes the default flow of the gateway. If the gateway has no default flow, an incident is created.
An exclusive gateway can also be used to join multiple incoming flows together and improve the readability of the BPMN. A joining gateway has a pass-through semantic and doesn't merge the incoming concurrent flows like a parallel gateway.
Conditions
It is a Jira Smart Value 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:
# | Expression |
---|---|
1 | pi.fields.summary == 'new Issue' |
2 | cur.fields.status.name == 'Reject' |
3 | cur.fields.priority.name == 'Low' |
4 | cur.fields.assignee.accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914' |
5 | cur.fields.customfield_10113 >= 5000 |
6 | pi.properties.flowerVariables.external.data.value >= 1000 |
7 | pi.fields.comment.comments[0].accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914' |
Parallel gateways
A parallel gateway (or AND-gateway) allows you to split the flow into concurrent paths.
When a parallel gateway with multiple outgoing sequence flows is entered, all flows are taken. The paths are executed concurrently and independently.
The concurrent paths can be joined using a parallel gateway with multiple incoming sequence flows. The process instance waits at the parallel gateway until each incoming sequence is taken.
The outgoing paths of the parallel gateway are executed concurrently and not parallel in the sense of parallel threads. All records of a process instance are written to the same partition (single stream processor).
Event-based gateways
Inclusive gateways
Currently, Flower 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 Jira Smart Value 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:
# | Expression |
---|---|
1 | pi.fields.summary == 'new Issue' |
2 | cur.fields.status.name == 'Reject' |
3 | cur.fields.priority.name == 'Low' |
4 | cur.fields.assignee.accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914' |
5 | cur.fields.customfield_10113 >= 5000 |
6 | pi.properties.flowerVariables.external.data.value >= 1000 |
7 | pi.fields.comment.comments[0].accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914' |