Decisions and conditions
Make the workflow take one path or another based on the ticket, the form or the result of a task, with safe conditions.
On this page
A Decision (exclusive gateway) makes the workflow take only one of several paths. Each path leaving the decision has a condition, for example "the priority is P1" or "it was approved", and one can be the default path, for when no condition is met.
Before you start
You need Administer in Workflows.
Add a Decision (exclusive gateway) from the palette and connect it to at least two paths.
Steps
Select the decision. In Properties, Outgoing paths lists each path leaving it, with its condition, the default tag or no condition in red.
Press an outgoing path in the list (or select the connection in the diagram).
Choose one of two options:
Check Default path (if no condition is met). A decision has only one default path.
Or enter the Condition, for example
ticket.priority == 'P1'.
As you type, the panel tells you whether the condition is right: Valid condition. in green, or the problem in red.
Repeat for each outgoing path.
Name each connection (double-click it), like "Approved" or "P1". It shows in the diagram and in the Outgoing paths list.
How to write a condition
A condition compares workflow values. It's written with variables, text in single quotes, numbers and operators.
Available variables
Variable | What it contains | Example |
|---|---|---|
| Ticket number. |
|
| Ticket type: |
|
| Priority: |
|
| State: |
|
| Whether the requester is VIP: |
|
| Id of the ticket's category, service, group or department. |
|
| A custom field on the ticket. |
|
| An answer from the catalog request form. |
|
| Result of a task or approval: |
|
| An answer from a task's form. |
|
| What a previous action or wait left behind. |
|
<id> is the element identifier you see at the top right of Properties when you select it (for example Activity_1x2y3z). Ticket values are read at the moment the workflow reaches the decision.
Operators
Operator | Meaning | Example |
|---|---|---|
| Equal and not equal. |
|
| Less than and greater than. |
|
| Is in a list. |
|
| A list or text contains a value. |
|
| And: both are met. |
|
| Or: either is met. |
|
| Not. |
|
Use parentheses to group. Text goes in single quotes ('P1') and you can also use true, false and null.
Rules worth knowing
Conditions are safe: they don't run code, don't call functions and only read the variables in the table.
Up to 500 characters per condition.
A variable that doesn't exist is
null; it doesn't cause an error.Comparing different types (text with a number) gives
false.If more than one condition is met, the workflow takes only one path: write conditions that don't overlap.
Default path
The default path is taken when no condition is met. If the decision doesn't have one and no condition is met, the instance stops with an error. That's why you'll see a warning when you validate if it's missing.
Connections with a condition outside a decision
Only connections leaving a decision are evaluated. If a connection leaving another element has a condition (for example, from an imported diagram), the panel shows This connection has a condition but does not leave a decision: the engine ignores it. Press Remove the condition to clear it.
If something doesn't work
Message | What to do |
|---|---|
No condition: mark it as the default path or write one. | That outgoing path has no condition. Write one or mark it as the default path. |
"…" is not an allowed variable (ticket, form, vars, task). | Start the variable with |
Missing field: "ticket.campo". | Also write the field, for example |
Unclosed text. | You're missing a single quote. |
Function calls are not allowed. | Remove the parentheses after a variable name. |
The condition is in another language; rewrite it for Elion ITSM. | The diagram comes from another tool: write the condition again. |
When validating: the path "…" has no condition and is not the default path. | Complete that outgoing path. |