Skip to main content

Line Rules

Line Rules are often called Business Rules in EmpowerID. They are logical expressions, based on Boolean values, which are applied to the connections between workflow activities where the process flow may branch off in different directions due to varying conditions. When you assign a Line Rule to a connection between activities, you define the criteria that dictate whether the process can follow that particular path or not.

To add line rules to workflows

  1. Right-click on the line where you want to apply the Line Rule, and Select Line Rule from the context menu. The Select Rule popup will appear — from there, click the Add New button.
Workflow Page
Workflow Page
  1. Enter a name for the Line/Business Rule in the Workflow Business Rules window that opens and click the Add button.
Workflow Page
Workflow Page
  1. Double-click the new rule to create an event handler or class for it. Workflow Page

  2. The class will have three methods:

    • Evaluate: This method is executed first when the workflow engine encounters a line with a Business Rule or Line Rule applied.

    • ExecuteOnIfRuleEvaluatedTrue: This method executes when the condition in the 'Evaluate' method is true.

    • ExecuteOnIfNotRuleEvaluatedTrue: This method executes when the condition in the 'Evaluate' method is false.

  3. In the C# Editor that opens, you can add a code snippet for a Line Rule. Here’s an example of a simple Line Rule written in the Evaluate method:

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

  1. 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. Workflow Page

  2. 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" 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. Workflow Page

  3. Click OK to close the Select Rule window.

  4. 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."

  5. The lines change color after the Line Rules are applied. Workflow Page

info

Key

  • Orange lines indicate that the attached line rule evaluates to false.
  • Blue lines indicate that the attached line rule evaluates to true.
  • Black lines indicate that there is no line rule applied.