Add a Decision to a Workflow

Use a decision block in your workflow to determine which step to run next depending on logic you specify.

For example, the workflow below sends an invoice to the customer. The workflow follows a different path depending on whether the customer has email or not.

A decision can have only two outcomes: Yes and No.

To add a decision to a workflow, you need to:

  • Add and connect the decision to the workflow.

  • Define the decision logic.

Add and Connect the Decision

  1. Open the workflow.

  2. Drag and drop a decision onto the workflow canvas.

  3. Click the decision.

  4. Click on one of the anchors around the decision and drag a connector towards the step that must be performed if decision answer is Yes.

  5. Click on another of the anchors around the decision and drag a connector towards the step that must be performed if decision answer is No.

  6. To rename the decision, either

    • Double-click the decision and edit the text, or

    • Right-click the decision, select Rename Step, and edit the text.

Define Decision Logic

The logic of a decision is defined in the Builder area below the workflow canvas.

The decision below checks whether the value of the Email property of the Customer variable is not empty. If the property is found to be not empty, then the Yes transition will be followed. Otherwise, the No transition will be followed.

The list of comparison operators displayed depends on the type of values entered into the properties of the If statement. For example, for text values the list of comparison operators includes is empty, matches, and contains. Those options are not available if number values are entered. The table below lists the operators and explains how they are applied to each variable type.

Operator

Text

Number & Decimal

Date/Time

Boolean

equals The two strings are identical and are of same case. The values are equal. Both dates and times are equal. The values are equal.
equals (ignore case)

The two strings are identical. If the only differences are in case, the strings are considered equal.

N/A N/A N/A

To define decision logic:

  1. Click the first parameter to open the Selector window.

  2. Select any simple variable, a property of a complex variable, or a function or method that returns an output of the correct type and does not require input parameters.

  3. Click .

  4. Select the logic operator to apply from the drop-down list.

  5. Specify the second parameter if necessary. Some logic operators do not require a second parameter.

The full process is demonstrated in the video below.

Define Compound Decision Logic

You can define compound logic by combining multiple conditions using AND and OR logic.

For example, this workflow decides whether or not to send an invoice to a customer.

An invoice should only be sent if:

  • The amount owed is larger than $10, AND

  • The customer's email address is known, OR if the customer's postal address is known.

The logic definition is shown below:

Use the following controls:

Add a sibling condition

Add a group

Ungroup

Delete a condition

Set the logic to apply within a group.

The full process is demonstrated in the video below.

Modify a Decision

Once a decision has been placed on the workflow canvas, right-click the decision to:

  • Open the Usage Reference panel to identify if and where the decision is referenced in the project.

  • Rename the decision.

  • Delete the delete the decision.