Skip to Content
Flower 3.2.2 is released 🎉
DocsConceptsDecision Handling in Gateways
Image

BPMN Gateways & Decision Handling

BPMN Gateways & Decision Handling

Automating decisions in Jira workflows can drastically improve efficiency and eliminate bottlenecks.
With BPMN Gateways, you can define clear decision logic and let Flower BPM handle the rest.

This guide will show you how to craft decision expressions using Jira Smart Values, ensuring smooth and automated process execution.


Expressions with Jira Smart Values

When a process reaches a BPMN Gateway, a decision needs to be made.
The Flower BPM Engine evaluates this decision based on predefined expressions.

Expressions use Jira Smart Values  and are stored directly on the outgoing transitions from the gateway.

Jira Smart Value Expressions used in XOR gateway

  • The process follows the first transition where the expression evaluates to true.
  • Expressions can reference:
    • The current process instance (pi)
    • The current activity (cur)
    • Jira issue properties (flowerVariables)
ℹ️

If a transition loops back to a previously completed activity, it will be reopened,
as long as your Jira workflow configuration allows it.


Using Jira Smart Values in BPMN Expressions

Jira Smart Values  allow you to access issue fields and properties dynamically.
They are also widely used in Jira Automations .

For example:

pi.fields.summary

This returns the summary of the current process instance.

Example Expressions:

#Expression
1pi.fields.summary == 'New Issue'
2cur.fields.status.name == 'Rejected'
3cur.fields.priority.name == 'Low'
4cur.fields.assignee.accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914'
5cur.fields.customfield_10113 >= 5000
6pi.properties.flowerVariables.external.data.value >= 1000
7pi.fields.comment.comments[0].accountId == '557058:fc60faa5-f40d-4344-ae2b-4becd42a7914'

These conditions ensure that only relevant transitions are activated, reducing manual input and automating decision-making.


Integrating External Data into Gateway Decisions

Sometimes, decisions depend on external data not stored in Jira. Flower BPM allows external data to be stored as JSON in the process instance, which can then be referenced in expressions.

Storing External Data via the Jira REST API

Jira provides a REST endpoint for Issue Properties  to store JSON data on a Jira issue.

curl --request PUT \ --url 'https://your-domain.atlassian.net/rest/api/3/issue/FLOWER-2/properties/flowerVariables' \ --user '[email protected]:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{"some":"value"}'

The JSON data can be as complex as needed but must not exceed 32,768 bytes. It can then be accessed in BPMN transitions:

pi.properties.flowerVariables.some=='value' //returns true

Default Transitions: Ensuring the Process Keeps Moving

In BPMN, Default Transitions ensure that if no conditions are met, the process follows a predefined path instead of getting stuck. This is particularly useful when working with decision gateways based on dynamic expressions, such as a Jira custom field.

Default Transitions

In our Capital Investment Approval Process, the approval decision is determined based on the Jira custom field “approval” at an exclusive gateway (XOR Gateway). The possible outcomes:

  • YES → CFO/Board Approval → Investment Execution
  • NO (Default) → Rework Request → Resubmit Investment Request
  • REJECT → Investment Rejected → End Process

Why Use a Default Path?

If an error occurs in the condition (e.g., missing or incorrect field values), the process does not break but follows the default path instead. This allows the requester to review, refine, and resubmit the investment request.

This approach ensures process robustness and smooth execution, even when data inconsistencies or missing values exist in Jira.


Learn More

Last updated on