An If-Else activity is intended to select exactly one branch of the activity from a given set of branches. For each branch, the activity checks the branch conditions and executes the first of the branches whose condition evaluates to TRUE.
The Workflow Designer provides a condition builder for configuring branch conditions, located in the If-Else Branch Activity Properties dialog.
To access the condition builder for an If-Else branch
-
Right-click the name of the branch and click Properties.
-
Go to the Conditions box in the If-Else Branch Activity Properties dialog that opens.
When you configure an If-Else branch, you need to add at least one condition. By default, a single, implied condition group is created when you add a branch condition. You can create additional condition groups to group a set of conditions and nest grouped conditions within other condition groups.
A condition group contains one or more conditions connected by the same logical operator. By grouping conditions, you specify that those conditions should be evaluated as a single unit. The effect is the same as if you put parentheses around an expression in a mathematical equation or logic statement.
To add a condition to a condition group
-
In the Search options box, under Filter, click the name of the condition group and then click Insert condition.
Click the plus sign (+) next to the name of the condition group.
You can remove a condition, if needed, by clicking X on the right side of the list item representing the condition in the Conditions box.
To add a condition group into another condition group
-
In the Conditions box, click the name of the condition group, point to Insert condition group, and then click an option to specify the logical operator:
-
AND group: The condition group evaluates to TRUE if all conditions in the group are TRUE.
-
OR group: The condition group evaluates to TRUE if any condition in the group is TRUE.
-
NOT AND group: The condition group evaluates to TRUE if any condition in the group evaluates to FALSE.
-
NOT OR group: The condition group evaluates to TRUE if all conditions in the group evaluate to FALSE.
-
By default, AND is the logical operator between the conditions in a condition group. It is possible to change the logical operator by converting the condition group to a different group type: Click the name of the group, point to Convert condition group to, and then click the option appropriate to the desired logical operator.
You can remove an entire condition group, if needed, by clicking the name of the group and then clicking Delete condition group.
Once you have added a condition to a condition group, you can use the following steps to configure the condition.
To configure a condition
-
Click Configure condition to evaluate, and then choose from the following options to specify the entity or field you want the condition to evaluate:
-
Property of workflow target object: Evaluate the value of a certain property of the target object of the request that started the workflow. The condition builder prompts you to choose the desired property. This option is unavailable in case of automation workflows.
-
Property of workflow initiator: Evaluate the value of a certain property of the user whose request started the workflow. The condition builder prompts you to choose the desired property.
-
Changed value of workflow target object property: Evaluate the value that is requested to be assigned to a certain property of the workflow target object, which represents the requested change to the property of the target object of the request that started the workflow. The condition builder prompts you to choose the desired property. This option is unavailable in case of automation workflows.
-
Activity execution status: Evaluate whether Active Roles encountered an error when running a certain activity. The condition builder prompts you to select the desired activity.
NOTE: This option requires the activity configuration to allow the workflow to continue even if the activity encounters an error.
-
Approver action choice: Evaluate the name of the action button applied by the approver to complete the approval task created by a certain Approval activity. Use this option to determine which action button the approver applied to allow the operation that was subject to approval. The condition builder prompts you to select the desired Approval activity. This option is unavailable in case of automation workflows.
-
Workflow parameter value: Evaluate the value of a certain parameter of the workflow. The condition builder prompts you to select the desired parameter from the workflow definition.
-
Property of object from workflow data context: Evaluate the value of a certain property of the object that will be selected by the If-Else activity on the basis of the data found in the workflow environment at the time of executing the workflow. The condition builder prompts you to choose the desired property and specify which object you want the activity to select upon evaluating the condition at workflow run time.
-
Value generated by rule expression: Evaluate the string value of a certain rule expression. The condition builder prompts you to configure a rule expression. By using a rule expression you can compose a string value based on properties of various objects found in the workflow environment at the time of executing the workflow. Active Roles calculates the value of your rule expression upon evaluating the condition at workflow run time.
-
-
Click the current comparison operator, if needed, and then click the operator you want the condition to use.
-
Click Define value to compare to, and then choose an option to specify the desired comparison value.
The list of options that are available to specify a comparison value depends upon the entity or field you have configured the condition to evaluate. The following table summarizes the comparison value options.
Condition to evaluate |
Comparison value options |
|
|
Activity run status |
|
Approver action choice |
|
For more information on comparison operators and comparison value options, see Search filter.