Skip to main content


LoyJoy provides a powerful expression language that allows you to evaluate expressions in experiences. The expression language is a subset of Jakarta Expression Language simplified for security concerns and allows you to access and combine process variables and functions programmatically.

Expressions can be used in conditions, in variable value assignments, and in interpolated texts such as chat message bubbles Welcome ${firstname} of age ${customerAgeYears()} or email templates. Expressions can range from simple expressions such as gender == "male" ? "Dear Mr." : "Dear Ms." to arbitrarily complex expressions such as stringContains(getParam("haystack"), "needle").


As literals you can use true, false, integers such as 1 or 2, floating point numbers such as 1.5 or 3.14, strings such as "foo", and null.


The decimal point of floating point numbers is written as a dot . and not as a comma ,.

Arithmetic Operators

There are 5 arithmetic operators:

  • Addition + such as 1 + 2 or 1 + someVar
  • Subtraction - such as 1 - 2 or 1 - someVar
  • Multiplication * such as 2 * 4 or 4 * someVar
  • Division / such as 4 / 2 or 4 / someVar
  • Remainder (modulo) % such as 8 % 3 or 8 % someVar

Relational Operators

There are 6 relational operators:

  • Equal == such as 1 == 1 or 1 == someVar
  • Not equal != such as 1 != 2 or 1 != someVar
  • Less than < such as 1 < 2 or 2 < someVar
  • Greater than > such as 3 > 2 or 3 > someVar
  • Less or equal <= such as 1 <= 2 or 2 <= someVar
  • Greater or equal >= such as 3 >= 2 or 3 >= someVar

Logical Operators

There are 3 logical operators:

  • And && / and such as 2 > 1 && true != false or 2 > 1 and true != false
  • Or || / or such as 2 > 1 || true != false or 2 > 1 or true != false
  • Not ! such as !someVar

Empty Operator

The empty operator can be used to determine if a value is null or empty such as empty someVar. In the example it returns true if someVar is not set or null or an empty string, and true otherwise.

Conditional Operator

The condition operator evaluates a condition, and depending on the condition result returns one of two results such as age >= 18 ? "Welcome" : "Not old enough".


Parentheses can be used to change precedence, such as a * (b + c).


Array elements can be accessed by index such as someArray[0] or someArray[someIndex]. The first array index is 0. The last array index is array length - 1.


Object properties can be accessed by . such as someObject.someProperty or [] such as someObject["someProperty"]. The index can be an expression such as someObject[someVar]. Typical use cases for accessing object properties are when accessing properties of JSON objects retrieved from APIs.


LoyJoy provides a growing list of functions that can be called from expressions such as customerAgeYears() >= 18 or isoLocalDate().


You can use variables in expressions if they have been generated before in the process such as cheesePreference == "strong".

Type Conversion

In LoyJoy all variables are texts (type String). Thus if you want to use variables as numbers or booleans, it might be necessary to make a type conversion. LoyJoy provides several such functions for type conversion:

  • Conversion to integer number with toBigInteger, toLong, toInteger, toShort, toByte such as toBigInteger("2") or toBigInteger(someVar). BigInteger can handle larger integer numbers than Long. Long can handle larger integer numbers than Integer, or Short, or Byte. In most cases BigInteger is recommended.
  • Conversion to floating point number with toBigDecimal, toDouble, toFloat such as toBigDecimal("2.5") or toBigDecimal(someVar). BigDecimal can handle larger floating point numbers than Double. Double can handle larger floating point numbers than Float. In most cases BigDecimal is recommended.
  • Conversion to boolean with toBoolean such as toBoolean("true") or toBoolean(someVar).