Using Conditional Expressions

Conditional expressions are used in a business process to determine the next steps that an instance of a process should take. For example, a form may be routed to different individuals for approval depending on the values of fields in the form.

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. This allows you to define the condition according to the XPath language. The conditional expression builder translates the information you enter into an XPath statement.

Conditional expression builder

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 determine whether a path is taken, 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 a 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".

    Conditional expression builder configured to match 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")

    Modified conditional expression

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.

Quotation marks around number that should be removed for numerical comparison.

Related Topics