Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Business Rules are Boolean expressions you write and apply to the lines that connect activities to one another at points logical expressions, based on Boolean values, which are applied to the connections between workflow activities where the process can flow may branch off in different directions depending on the conditions encountered by the activitiesdue to varying conditions. When you apply assign a Business Rule to an activity linea connection between activities, you are setting define the conditions criteria that determine dictate whether the process can flow through follow that line particular path or not.
To add business rules to workflows
Right-click anywhere on the white space of the workflow open in the Workflow Designer and select Workflow Business Rules from the context menu.
- Image Added
Enter a name for the Business Rule in the Workflow Business Rules window that opens and click
the Add button.
- Image Added
Double-click the new rule to create an event handler for it.
- Image Added
In the C# Editor that opens, you can add a code snippet for a Business Rule.
Image Removed
Here’s an example of a simple Business Rule:
Code Block language c# bool canProceed = false; // Add your custom logic here to determine if the process can proceed if (/* some_condition_here */) { canProceed = true; } else { canProceed = false; } return canProceed;
Apply the rule to activity lines
Right-click one of the lines proceeding from an activity where more than one outcome is possible and choose Select Line Rule from the context menu.
- Image Added
In the Select Rule window that appears, choose the desired rule from
the Rule
drop-down list
. If you want the process to flow through the line when
a "false
" condition is met, select
the "If Rule Not True
Image Removed
" option. If you want the process to flow through the line when a "true" condition is met, leave the "If Rule Not True" option unselected.
Image AddedClick OK to close the Select Rule window.
Repeat the process for the second line
originating from the same activity
. This time, set the "If Rule Not True
" option to the opposite
of what was set for the first line. If you selected the "If Rule Not True" option for the first line, leave it unselected for the second line and vice versa. This ensures that the workflow proceeds through one line when the condition is "true" and through the other line when the condition is "false."
The lines change color after the Business Rules are applied.
- Image Added
Info |
---|
Key Orange lines indicate that the attached business rule evaluates to false. Blue lines indicate that the attached business rule evaluates to true. Black lines indicate that there is no business rule applied. |
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
IN THIS ARTICLE
|