skip to main content
Corticon Studio: Rule Modeling Guide : Advanced Ruleflow techniques and tools : Conditional Branching in Ruleflows : Example of Branching based on a Boolean
 

Try Corticon Now
Example of Branching based on a Boolean
In the example, loan status does not pass through being declined on its way to being approved; it is one or the other. This true/false decision point (actually Ruleflows that might contain several Rulesheets) provides an easy introduction to branching.
To create a Branch on a Ruleflow canvas for a Boolean attribute:
1. On the Ruleflow canvas where you want to create a branch, click Branch on the Palette, and then click on the canvas where you want to place the branch. A Branch container is created with your cursor in the name label area.
2. Enter a name such as Loan Status, and press Enter. You can change the name later.
3. Drag the Rulesheets Approved.erf and Declined.erf from the Project Explorer to the branch compartment.
4. On the Branch's Properties tab for Branch Activity, click . The Select Branch Attributes for the Ruleflow's Vocabulary identifies three attributes that are candidates for branching (state, agency, and approved), and the associations that apply to these attributes. For this branch, approved is the Boolean attribute appropriate for loan status. More specifically the attribute preferred is, Applicant.mortgage.approved. Click on that attribute as shown:
5. Click OK.
6. You can define the Boolean branches in a few ways:
*Click on the Value pulldown, as shown:
Notice that there four choices for a Boolean. The null value is offered the attribute is not set as Mandatory so null is allowable. The other value is demonstrated below.
*Choose true on the first line and then choose other on the second line.
*Click Check for completeness, as shown, to populate the Value list from the attribute:
Notice that it does not add other to the list. If you set true and other as shown above, clicking Check for completeness would have nothing to add because other implies completeness. You can clear green highlights by clicking the Clear analysis results button.
The values listed are in red until we bind each one to a node. You can delete any or all but a minimal number of these lines if you do not have nodes that will handle specific cases. For this example, keep only true and false. Then click Cleanup to remove lines that no assigned node.
7. In the Branch Activity section, the Node column lets you click on a Value line and then use the pulldown to choose the appropriate target node for the value. When the request in process matches this value, it will be passed to this branch in the branch container: When both true and false have nodes specified, we have defined the required branches for this rule flow.
8. Connect the incoming and outgoing connections to the branch to complete the flow on the canvas.
Multiple values can direct to the same target node, as shown in this colorized examples, where all the 'not true' possibilities are assigned to the Declined node:
That completes the creation of this Boolean-based branch.