Version: 1.14

# Unary-Tests

A unary-tests expression is a special kind of boolean expression. It should be used for the input entries of a decision table (i.e. the conditions of a rule).

A unary-tests expression returns `true` if one of the following conditions is fulfilled:

• the expression evaluates to `true` when the input value is applied to it
• the expression evaluates to a list, and the input value is equal to at least one of the values in that list
• the expression evaluates to a value, and the input value is equal to that value
• the expression is equal to `-` (a dash)

### Comparison​

Compares the input value with a given value. Both values must be of the same type.

The input value is passed implicitly as the first argument of the operator.

OperatorDescriptionSupported types
(none)equal toany
<less thannumber, date, time, date-time, duration
<=less than or equal tonumber, date, time, date-time, duration
>greater thannumber, date, time, date-time, duration
>=greater than or equalnumber, date, time, date-time, duration
``"valid"< 10<= date("2020-04-06")> time("08:00:00")>= duration("P5D")``

### Interval​

Checks if the input value is within a given interval between `x` and `y`.

An interval have two boundaries that can be open `(x..y)` / `]x..y[` or closed `[x..y]`. If a boundary is closed then it includes the given value (i.e. less/greater than or equal). Otherwise, it excludes the value (i.e. less/greater than).

The input value is passed implicitly to the operator.

``(2..5)// input > 2 and input < 5]2..5[// input > 2 and input < 5[2..5]// input >= 2 and input <= 5(2..5]// input > 2 and input <= 5``

### Disjunction / Or​

Combines multiple unary-test expressions following the ternary logic.

• returns `true` if at least one unary-test evaluates to `true`
• otherwise, it returns `false`
``2, 3, 4// input = 2 or input = 3 or input = 4< 10, > 50// input < 10 or input > 50``

### Negation / Not​

Negates a given unary-test expression. The expression can be a comparison, an interval, or a disjunction.

It returns `true` if the given unary-test evaluates to `false`.

``not("valid")// input != "valid"not(2, 3)             // input != 2 and input != 3 ``

### Expressions​

Evaluates an expression that returns a boolean value. For example, invoking a function.

The input value can be accessed in the expression by using the symbol `?` (a question mark).

``contains(?, "good")// check if the input value (string) contains "good"ends with(?, "@camunda.com")// checks if the input value (string) ends with "@camunda.com"``