Using Conditional Expressions

Conditional expressions let you define the conditions that must be met for a particular outflow path to be taken or for a specific priority to be assigned to a task. Conditional expressions are necessary when several potential paths can be followed after a gateway or activity.

When you click in the Conditional Expression text box, the Conditional Expression Builder appears. Conditional expressions are written in XPath, a language designed to traverse XML structures. Luckily, you do not need to know XPath to create a conditional expression.

In the Conditional Expression Builder, specify the conditions that must be met for the action to occur. You can create conditional expressions based on:

Note: If you have multiple conditions that must be met for a path, you can insert operators (e.g., "and," "or") into your conditional expressions.

By default, conditional expressions are case-sensitive. Once you've created a conditional expression, you can modify it to make the expression case-insensitive.

Making Conditional Expression Case-insensitive

  1. Using the Conditional Expression Builder, create a conditional expression that uses the value that should be case-insensitive. The following image shows a match for a single line field to the value "test".

  2. After building the expression and clicking Insert, the statement for the conditional expression will appear in the text area below the Conditional Expression Builder.
  3. Edit the statement to fit the following structure: matches(/dataset/attribute_name, "value", "i")

Using Dates in Conditional Expressions

When specifying a date in a conditional expression, you'll need to use the expected date format yyyy-MM-dd (e.g., 2013-12-01).

Converting Strings to Numbers in Conditional Expressions

The values in number and currency fields are automatically treated as numbers when XPath statements are evaluated. If you want the value in a single line field to be evaluated as a number instead of as a string (letters), use the number() function to force the strings to numbers in number variables. For example, if "/dataset/Single_Line" is a string, you can type "/dataset/number(Single_Line)" to force the string to a number.

If you are already using a number, instead of a number variable, be sure to remove quotation marks from the value.

Related Topics