DocumentaciónHelp

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

  1. Select the decision. In Properties, Outgoing paths lists each path leaving it, with its condition, the default tag or no condition in red.

  2. Press an outgoing path in the list (or select the connection in the diagram).

  3. 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'.

  4. As you type, the panel tells you whether the condition is right: Valid condition. in green, or the problem in red.

  5. 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 number.

'REQ-000412'

ticket.kind

Ticket type: incident, request, problem or change.

ticket.kind == 'incident'

ticket.priority

Priority: P1 to P5.

ticket.priority in ['P1', 'P2']

ticket.state

State: new, assigned, in_progress, on_hold, resolved, closed, cancelled…

ticket.state == 'on_hold'

ticket.vip

Whether the requester is VIP: true or false.

ticket.vip == true

ticket.categoryId, ticket.serviceId, ticket.groupId, ticket.departmentId

Id of the ticket's category, service, group or department.

ticket.groupId == 4

ticket.custom.<clave>

A custom field on the ticket.

ticket.custom.centro == 'Santiago'

form.<campo>

An answer from the catalog request form.

form.monto > 1000000

task.<id>.outcome

Result of a task or approval: done, approved or rejected.

task.Activity_1x2y3z.outcome == 'approved'

task.<id>.data.<campo>

An answer from a task's form.

task.Activity_1x2y3z.data.resultado == 'ok'

vars.<id>.<dato>

What a previous action or wait left behind.

vars.Activity_9a8b7c.number != null

<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

== and !=

Equal and not equal.

form.tipo == 'notebook'

<, <=, >, >=

Less than and greater than.

form.cantidad >= 5

in

Is in a list.

ticket.priority in ['P1', 'P2']

contains

A list or text contains a value.

form.sistemas contains 'sap'

&&

And: both are met.

ticket.vip == true && ticket.priority == 'P1'

||

Or: either is met.

form.urgente == true || ticket.priority == 'P1'

!

Not.

!(ticket.state == 'cancelled')

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 ticket., form., vars. or task..

Missing field: "ticket.campo".

Also write the field, for example ticket.priority.

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.

Related

Search Elion ITSM

Type at least 2 characters to search Elion ITSM.

↑↓ to navigate · Enter to open · Esc to close