Decision Expression Examples

Example Data Objects

For the following examples, the workflow definition includes the following data objects:
Label
Data Type
Name
ProductId
String data object
Discount
Numeric data object
Cost
Numeric data object
SalePrice
Numeric data object
ShipDate
Date data object (includes both date and time values)

Example 1: Comparing the Value of a Data Object to a String Constant

ProductId == "A123B"

Example 2: Comparing the Values of Multiple Data Objects to String Constants

(ProductId == "A123B") && (Name == "Smith")

Example 3: Comparing the Value of a Data Object to a Numeric Constant

Discount >= 5

Example 4: Comparing the Values of Two Different Data Objects

SalePrice == (Cost – Discount)

Example 5: Expression Using the UPCASE Function

upcase(ProductID) == "A1235CC"

Example 6: Expression Using Data Object Substitution

This example uses the ${} syntax so that the complete path to the data object can be specified. (See Data Object Substitution.) This is useful if a global data object defined on the root task and a local data object have the same name, and if you want the decision gateway to use the global object. In this example, the decision gateway uses the data object Discount that is defined on the parent workflow.
${/Main/Discount} > 1000
Note: Data determination logic is supported to ensure backward compatibility with previous versions of workflow. All data objects should be defined explicitly using the appropriate data type (Date , Numeric , Short Text , and so on). In subsequent releases, processing will honor only the specified data type and all support for real-time data type determination will be removed.

Example 7: Expressions Using TODAY and Date Functions

The following example compares the date portion of the ShipDate data object with the date portion of today’s date and time.
datepart(ShipDate) == today()
Because the left side of the example uses only the date part of ShipDate, only the date part of today’s date is used in the comparison.
The following example compares the time portion of the ShipDate data object with the time portion of today’s date and time. The TIMEPART function resolves to milliseconds, so it is recommended that you use a comparison operator other than equals (==) with this function.
timepart(ShipDate) >= today()
It is also recommended that you use a comparison operator other than equals (==) if you are comparing full datetime values.
ShipDate > today()
Last updated: March 5, 2020