Preconditions or Decision trees

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Policies >

Preconditions or Decision trees

Overview

Preconditions contain logical conditions that allow or restrict the execution of elements found in the lower hierarchy. They allow you to define a condition hierarchy to organize the execution of actions based on simple logic.

In other words, Preconditions allow you to build decision trees.  Each Precondition creates a branch of the tree and the nodes execute actions.

Thus, each Precondition is triggered by the evaluation of a parent condition.  The decision tree starts by reviewing conditions and according to the result it will make a decision, or fulfill an action. Bizagi Preconditions can have as many levels of nesting as needed.

 

The next image presents a decision tree where according to some conditions, a person will decide what to do on a weekend:

If the parents are visiting, the plan will definitely be to go to the cinema. If the parents are not visiting then a new condition is evaluated, namely to assess the weather. If it is sunny they will play tennis, otherwise the alternative option is to go to the cinema.

 

 

 

Preconditions2

 

 

Each branch of the tree is a precondition that can be established by multiple steps. A single precondition does not determine an action, but is merely an evaluator that leads to an action. Therefore, at the end of each path or branch, a Policy Rule, a Decision table or a Rules group must be created, which will be responsible for the last validation and execution of the required action according to the result of the validation.

 
 

Policies3

 

In order to create Preconditions follow the next procedure:

 

1. Go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

 

Defining Notifications 4

 

 
2. Click the shape where the policy is to be created and select On Enter, On Save or On Exit to create the policy.

Select the Policy item.

 

CreatingPolicies1

 

 

3. Click New on the upper left corner.  In a new window enter the name, display name and description of the policy.

Click OK.

 

 

CreatingPolicies2

 

 

4. In the Policy Manager select New Precondition

 

Preconditions3

 

5. The following window will be displayed. Unlike the editor of Policy Rules, this interface does not have the Then and Else section.

 

 

Preconditions4

 

6.  Include the condition to be evaluated. Drop and drag Vocabulary definitions to the If condition box on the left.

Click the Add Condition button to include as many options as necessary to evaluate the rule.

 

Preconditions5

 

7. Once you have included the required conditions save the changes by clicking the Finish button.

 

The precondition is now displayed in the Policy Manager.

 

Preconditions6

 

When the cursor is hovered over the precondition a tool tip will show a quick view of the content of the precondition.

 

 

Preconditions7

 

8. Right click the precondition to create branches that will be evaluated when the precondition is fulfilled.
In this manner, a hierarchy of branches (preconditions) and action elements (Policy Rules, Decision Tables, or Policy Rule Groups) can be created.

 

 

Preconditions8

Preconditions8
 

 

Recall, that a single precondition does not determine an action.  So, at the end of each path or branch, a Policy Rule, a Decision table or a Rules group must be defined to determine the action.

Once the hierarchy of Preconditions and actions have been created, the Policy can be illustrated as follows:

 

 

Preconditions9

 

 

Example

Imagine you work in a bank. The bank has set polices of the amount a Client can request in loan products based on his or her income and employee status. The conditions are listed below:

 

If their income is less than US$500 the client will not be eligible.

If their income is between US$500 and US$3,000, eligibility depends on the employee status.

If their income is greater than US$3,000 the client is always eligible.

 

Income

Employed?

Eligible?

< 500

YES/NO

NO

> 500 and < 3000

YES

YES

> 500 and < 3000

YES

NO

> 3000

YES/NO

YES

 

This situation can be represented as a Decision tree, which is illustrated below:

 

 

Preconditions1

 

 

1. Go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the shape where the policy will be created and select On Enter, On Save or On Exit to create the policy.

Select the Policy item.

 

 

CreatingPolicies1

 

2. In the Policy Manager select New Precondition.

 

Preconditions3

 

3. Create the conditions related to the first Precondition. In this case we define the first range for the client´s income. Click Finish.

 

Preconditions10

 

4. Type a Name, Display Name and Description for the Precondition. Click Finish.

 

Preconditions11

 

 

5. Repeat the previous steps to create Preconditions for the remaining ranges of client´s income.

 

Preconditions12

 

Up to this point we have created the first part of our Decision tree:

Preconditions13

 

 

6. Right-click a Precondition and, as per this example, select the option New Policy rule to define a lower hierarchy level.

 

 

 

Preconditions14

 

 

7. Include the necessary conditions and the final action. Type a name, display name and description for the Policy Rule and click Finish.

 

 

Preconditions15

 

The new Policy will be shown as a child node of the Precondition where we created it.

 

Preconditions16

 

8. Repeat the previous step for all the child Policy Rules. In this example we need two more Rules:

 

Preconditions17

 

 

At this point the Decision tree looks as shown below:

 

Preconditions18

9. Repeat the previous steps for all the Preconditions

 

Preconditions19.

 

 

Once all elements have been created, the complete Decision tree image will appear as below:

 

Preconditions20