A Singapore Government Agency Website

Expression syntax reference

Opus uses ZEN Expression Language for writing conditions, formulas, and logic in Decision nodes, Switch nodes, Expression nodes, and Decision Tables. This reference documents all supported operators, functions, and data types.

Operators

Arithmetic

Operator Description Example Result
+ Addition 100 + 100 200
- Subtraction 200 - 100 100
* Multiplication 10 * 10 100
/ Division 100 / 10 10
% Modulo 10 % 3 1

Comparison

Operator Description Example Result
== Equal 10 == 10 true
!= Not equal 10 != 5 true
> Greater than 10 > 5 true
>= Greater than or equal 10 >= 10 true
< Less than 5 < 10 true
<= Less than or equal 5 <= 10 true

Logical

Operator Description Example Result
and Logical AND true and false false
or Logical OR true or false true
not Logical NOT not true false

Ternary

condition ? valueIfTrue : valueIfFalse

Example: age >= 18 ? "adult" : "minor"

Data type reference

For detailed functions and examples per data type, refer to the sub-pages:

Data type What it covers
String Concatenation, case conversion, pattern matching, extraction (len, upper, lower, contains, matches)
Number Arithmetic, rounding (floor, ceil, round), absolute values, random numbers
Boolean Logical operators, comparisons, ternary expressions
Date and time Parsing, formatting, date arithmetic, component extraction (year, month, day)
Array Aggregation (sum, max, min), filtering, mapping, sorting
Context Accessing input data, variables, and upstream node outputs

The individual data type pages from the source repo (4.decision/expression-language/) should be restructured to match this reference and placed in an expression-syntax-reference/ subfolder. [VERIFY: confirm file paths with writer before restructuring]

Chat with me!
Bot Launcher