Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Business Rules 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 Business Rule to a connection between activities, you define the criteria that dictate whether the process can follow that particular path or not.

To add business rules to workflows

  1. Right-click anywhere on the white space of the workflow open in the Workflow Designer and

select 
  1. select Workflow Business Rules

 from
  1.  from the context menu.

Image Removed
  1. Image Added

  2. Enter a name for the Business Rule in the Workflow Business Rules window that opens and click

on the Add button
  1. the Add button.

Image Removed
  1. Image Added

  2. Double-click the new rule to create an event handler for it.

Image Removed
Add code for the Business Rule in
  1. Image Added

  2. In the C# Editor that opens, you can add a code snippet for a Business Rule.


Image Removed
  1. Here’s an example of a simple Business Rule:

    Code Block
    languagec#
    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 
  1. choose Select Line Rule

 from
  1.  from the context menu.

Image Removed
  1. Image Added

  2. In the Select Rule window that appears, choose the desired rule from the

 
  1. Rule

 
  1. drop-down list

, select the rule. To have
  1. . If you want the process to flow through the line when a

 
  1. "false

 
  1. " condition is met, select

the 
  1. the "If Rule Not True

 option. Otherwise leave the option cleared.
Image Removed
Click OK to
  1. " 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 Added

  2. Click OK to close the Select Rule window.

  3. Repeat the process for the second line

proceeding
  1. originating from the same activity

, this time setting the 
  1. . This time, set the "If Rule Not True

 
  1. " option to the opposite

as that set
  1. 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."

  2. The lines change color after the Business Rules are applied.

Image Removed
  1. Image Added


Info
iconfalse
title

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.


topicTOC
Div
class
stylefloat:left; position:fixed; padding: 5px;
idtocarticleNav

IN THIS ARTICLE

Table of Contents
div
Table of Contents
maxLevel
maxLevel
stylefont-size: 1rem; margin-bottom: -65px; margin-left: 40px;text-transform: uppercase;

On this page

4
minLevel2
stylenone
printablefalse