BPMN Conditional Events
In short: A conditional event is a circle with a lined sheet of paper. It fires when a business condition becomes true: the stock falls below 10, the temperature rises above the limit, the request is rejected. The condition is an expression on data, not a moment in time and not a message.
Guide: Branch with Conditional Boundary Events shows how to write the condition and model the event in Flower.
Symbols
| Symbol | Element | Meaning |
|---|---|---|
| Conditional start event | The process starts when the condition becomes true | |
| Intermediate conditional event (catch) | The process waits here until the condition is true | |
| Conditional boundary event, interrupting | While the activity runs, the condition becomes true: the activity ends and the path of the event is taken | |
| Conditional boundary event, non-interrupting | The activity stays open and the path of the event starts in addition. Dashed border |
A conditional event is always a catch event. Nothing in the process throws it: the condition is watched, and when the data changes so that it becomes true, the event fires.
Conditional Event or Gateway?
Both use a condition, but at different times:
| Exclusive gateway | Conditional event | |
|---|---|---|
| Checks the condition | Once, at the moment the token arrives | While it waits, until the condition becomes true |
| Question | Which way now? | Has it happened yet? |
| Example | Amount above 1,000? | Wait until the stock is refilled |
Use a gateway to decide with the data you have. Use a conditional event to wait for a change, or to react to one while a task is running.
In Flower and Jira
Conditional boundary events are executed from Flower 3.7.0.
| Element | Status in Flower |
|---|---|
| Conditional boundary event on a task, interrupting and non-interrupting | Executed |
| Conditional start event, intermediate conditional event, conditional event sub-process | Can be modeled, ignored during execution |
In Flower, the work item of the task decides. Flower checks the condition once, when the work item is resolved:
| Condition when the work item is resolved | Interrupting | Non-interrupting |
|---|---|---|
| true | The path of the event instead of the normal flow | The path of the event and the normal flow |
| false | The normal flow | The normal flow |
This differs from the standard, where the event fires as soon as the condition becomes true. A change to the work item while it is still open does not trigger the event. To react during the work, use a timer or an escalation event.
The condition is the same kind of expression as on a gateway. cur is the resolved work item of the task, pi is the process instance:
| Event label | Condition |
|---|---|
| Rejected | ${cur.fields.resolution.name == 'Rejected'} |
| Cancelled | ${cur.fields.status.name == 'Cancelled'} |
| Big order | ${pi.fields.customfield_10050 > 10000} |
A typical use is a compact approval: the approval task gets an interrupting conditional boundary event Rejected, and its path leads back to the work. No gateway is needed after the task. See Make Approval Steps.
The step-by-step guide is Branch with Conditional Boundary Events.
Conditional, Error, or Escalation?
| Conditional | Error | Escalation | |
|---|---|---|---|
| Trigger in Flower | An expression is true when the work item is resolved | The work item is resolved in the selected status | The work item is moved into the selected status |
| When | When the task ends | When the task ends | While the task is open |
| Meaning | Any outcome | The task failed | Someone else has to help |
| Interrupting | Either | Always | Either |
Common Mistakes
- A conditional event where a gateway is enough. If the data is known when the token arrives, use a gateway.
- A condition on time. Use a timer event.
- In Flower: expecting the event to fire while the work item is open. It is checked at resolution.
- A condition without a label. Name the event after the outcome, for example Rejected.
Read More
- Branch with Conditional Boundary Events: the guide for Flower
- Decision Handling in Gateways: how to write conditions
- BPMN Error Events and BPMN Escalation Events
- BPMN Events: all event types and positions
Frequently Asked Questions
What is a conditional event in BPMN?
An event that fires when a business condition becomes true, for example a value that passes a limit. It is drawn as a circle with a lined sheet.
What is the difference between a conditional event and a gateway?
A gateway checks its conditions once, when the token arrives. A conditional event waits until its condition becomes true.
Can a conditional event be a boundary event?
Yes, interrupting or non-interrupting. It reacts to a condition that becomes true while the activity runs.
How do I branch on the result of a Jira work item in BPMN?
With Flower, attach a conditional boundary event to the task and write a condition on a field of the work item, for example its resolution. Flower checks it when the work item is resolved.