Expression language#
The default expression language in Operaton BPMN models is JUEL, Java Unified Expression Language. JUEL is a simple expression language that can be used to reference objects in a Java environment.
Syntax#
The syntax for JUEL expressions is ${}
for immediate evaluation and #{}
for deferred evaluation. Yet, in Operaton, all expressions are evaluated during runtime, when the element containing the expression is executed, so it is best to just use ${}
for all expressions.
Here are some examples of JUEL expressions:
Expression |
Expected Type |
Result |
---|---|---|
Hello, World! |
String |
“Hello, World!” |
Hello, ${“World!”} |
String |
“Hello, World!” |
${3.14} |
double |
3.14 |
${null} |
null |
null |
${true && false} |
Boolean |
false |
${5 + 10} |
int |
15 |
${4 > 3} |
Boolean |
true |
${5 > 3 ? “Yes” : “No”} |
String |
“Yes” |
${3 > 5 ? “Yes” : “No”} |
String |
“No” |
${empty “”} |
Boolean |
true |
${empty null} |
Boolean |
true |
${empty “text”} |
Boolean |
false |
Operators in expressions#
JUEL supports the following operators:
Type |
Operators |
---|---|
Arithmetic |
|
Logical |
|
Relational |
|
Empty |
|
Conditional |
|
Reserved words#
The following words are reserved in JUEL and cannot be used as variable names:
Word |
Description |
---|---|
|
Logical AND |
|
Logical OR |
|
Logical NOT |
|
Equal to |
|
Not equal to |
|
Less than |
|
Greater than |
|
Less than or equal to |
|
Greater than or equal to |
|
Boolean true |
|
Boolean false |
|
Null value |
|
Checks if an object is an instance of a class |
|
Checks if a value is null or empty |
|
Division |
|
Modulus |
Objects in expressions#
To refer to variables or objects and their properties and methods, you can use the following syntax:
Syntax |
Description |
---|---|
|
Refers to a variable |
|
Refers to an object’s property |
|
Calls an object’s method |
For example, if you have an execution object (like in Operaton expressions), you can refer to its properties and methods as follows:
Expression |
Description |
---|---|
|
Refers to the business key property |
|
Refers to the process instance ID |
|
Calls |
|
Calls |
|
Calls |