Define Business Events > Defining business events based on native workflows > Expressions
  

Expressions

Use expressions to define values for the input fields of the Application Integration process that you selected for the service task, and to configure the outcomes of outgoing connections.
You can use the following types of expressions:

Boolean

Use Boolean expressions to determine whether a condition is met.
A Boolean expression can have one of following output values:

Compare two values

Use equality, inequality, and other relational conditions to compare two values.
The following table lists the operators that you can use to compare two values:
Name
Operator
Supported Value Types
Example
Equal to
=
Note:
If the canvas interface is translated to a language other than English, use
==
.
Any value
Consider the following conditions:
Compare numeric values
service_task_2.output.score.creditScore = 5
If the value of the service_task_2.output.score.creditScore expression is 5, the result of the condition is true.
Compare a value with a null value
service_task_2.output.score.bureau = null
If the value of the service_task_2.output.score.bureau expression is not null, the result of the condition is false.
Compare null values
null = null
The result of the expression is true.
Not equal to
!=
Any value
Consider the following conditions:
Compare numeric values
service_task_2.output.score.creditScore != 5
If the value of the service_task_2.output.score.bureau expression is 5, the result of the condition is false.
Compare a value with a null value
service_task_2.output.score.bureau != null
If the value of the service_task_2.output.score.bureau expression is not null, the result of the condition is true.
Compare null values
null != null
The result of the expression is false.
Less than
<
Numeric. Enter a numeric value that can be an integer or a decimal.
Consider the following condition:
service_task_2.output.score.creditScore < 6
If the value of the service_task_2.output.score.creditScore expression is less than 6, the result of the condition is true.
Less than or equal to
<=
Numeric. Enter a numeric value that can be an integer or a decimal.
Consider the following condition:
service_task_2.output.score.creditScore <= 11
If the value of the service_task_2.output.score.creditScore expression is less than or equal to 11, the result of the condition is true.
Greater than
>
Numeric. Enter a numeric value that can be an integer or a decimal.
Consider the following condition:
service_task_2.output.score.creditScore > 7
If the value of the service_task_2.output.score.creditScore expression isn't greater than 7, the result of the condition is false.
Greater than or equal to
>=
Numeric. Enter a whole or decimal number.
Consider the following condition:
service_task_2.output.score.creditScore >= 20
If the value of the service_task_2.output.score.creditScore expression is greater than or equal to 20, the result of the condition is true.
Ensure that the you compare values of the same type.

List

Use List expressions to manage a list of values. You can create a list, add values to a list, and also combine multiple lists.

Create a list

To create a list of values, use the following format:
[value1,value2,value3]
For example, to create a list of numeric values, use the following expression:
[service_task_1.output.score.creditScore,service_task_2.output.score.creditScore,service_task_3.output.score.creditScore]

Retrieve a value in the list

To retrieve a value at a specific position within a list, use the following format:
[list][index]
For example, if you used the following expression to retrieve the second element in a list :
[service_task_1.output.score.creditScore,service_task_2.output.score.creditScore,service_task_3.output.score.creditScore][2]
If the index starts at 1, the result of the expression is the value of service_task_2.output.score.creditScore.
Typically, the index of a list starts at 1.

Numeric

Use numeric values or perform arithmetic operations to derive numerical values.
You can use a numeric value, such as 7, 3.14, 8.24, 300, directly in your expression.
The following table describes the types of arithmetic operations that you can perform with numeric expressions:
Name
Description
Operator
Example
Addition
Adds value to another value.
+
Consider the following expression:
service_task_2.output.score.bureau + 3
If the value of service_task_2.output.score.bureau is 2, the result of the expression is 5.
Subtraction
Subtracts a value from another value.
-
Consider the following expression:
3 - service_task_2.output.score.bureau
If the value of service_task_2.output.score.bureau is 2, the result of the expression is 1.
Multiplication
Multiplies a value by another value.
*
Consider the following expression:
5 * service_task_2.output.score.bureau
If the value of service_task_2.output.score.bureau is 3, the result of the expression is 15.
Division
Divides a value by another value.
/
Consider the following expression:
service_task_2.output.score.bureau / 2
If the value of service_task_2.output.score.bureau is 6, the result of the expression is 3.
Exponentiation
Raises a value to the power of another value.
**
Consider the following expression:
service_task_2.output.score.bureau ** 3
If the value of service_task_2.output.score.bureau is 2, the result of the expression is 8.

Lookup

Use a lookup expression to get a value that is associated with a key.
To retrieve values that are associated with a key, use the following format:
<servicetask>.output.<key>
In lookup expression, enter values for the following parameters:
If the value that you want to retrieve doesn't exist, the result of the expression is null.
For example, consider the following response from an Application Integration process for a service task with the ID, service_task1:
[
{
 “taskId”: “service_task1"
"requestId": "req-7f3a9b1b-4de2-4f0f-9f8a-9f2fdb80c1b2",
"customer": {
"customerId": "CUST-002913",
"nationalId": "ABCDE1234F",
"fullName": "Kathy Smith",
"dob": "1993-07-21"
},
]
To retrieve the value of the fullname parameter, use the following expression:
service_task1.output.customer.fullname
The result of the expression is Kathy Smith.

String

Use string values in various ways within any expression.
You can use a string value such as ice, cream, directly in your expression.

Combine string values

You can add multiple string values to create a new string value that contains characters of all the strings.
Consider the following expression:
service_task_2.output.score.scoreBand + "-Score"
If the value of service_task_2.output.score.scoreBand is Good, the result of the expression is Good-Score.