Conditions

Conditions can be used for conditional flows to determine the following task.

A condition is a Boolean expression with a JavaScript-like syntax. It allows to compare variables of a workflow instance with other variables or literals (e.g., numbers, strings, etc.).

Variables of a workflow instance are accessed by its name. If a variable has a document value then the nested properties can be accessed via dot notation. See the Variables section for details.

Examples:

totalPrice > 100

owner == "Paul"

order.count >= 5 && order.count < 15

Literals

Literal Examples
Variable totalPrice, order.id
Number 25, 4.5, -3, -5.5
String "Paul", 'Jonny'
Boolean true, false
Null-Value null

A Null-Value can be used to check if a variable or nested property is set (e.g., owner == null). If a variable or nested property doesn't exist, then it is resolved to null and can be compared as such.

Comparison Operators

Operator Description Example
== equal to owner == "Paul"
!= not equal to owner != "Paul"
< less than totalPrice < 25
<= less than or equal to totalPrice <= 25
> greater than totalPrice > 25
>= greater than or equal to totalPrice >= 25

The operators <, <=, > and >= can only be used for numbers.

If the values of an operator have different types, then the evaluation fails. Comparing null or missing property with a number is considered as comparing different types.

Logical Operators

Operator Description Example
&& and orderCount >= 5 && orderCount < 15
|| or orderCount > 15 || totalPrice > 50

It's also possible to use parentheses between the operators to change the precedence (e.g., (owner == "Paul" || owner == "Jonny") && totalPrice > 25).