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 in a Ruleflow that
contains several Rulesheets provides an easy introduction to branching.
To create a branch on a Ruleflow canvas for a Boolean
attribute:
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.
Enter a name such as Loan Status, and
press Enter. You can change the name later.
Drag the Rulesheets Approved.erf and
Declined.erf from the Project Explorer to the branch
compartment.
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 specific, the attribute preferred is Applicant.mortgage.approved. Click on that attribute as shown:
Click OK.
You can define the Boolean branches in a few ways:
Click the Value drop-down list, as
shown: Notice that there four choices for a Boolean. The null value is offered
because 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 each one is bound 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.
In the Branch Activity section, the Node column lets you click a Value line and then use the drop-down list 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, the required branches for this rule flow are
defined.
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 these colorized
examples, where all the 'not true' possibilities are assigned to the Declined node:
That completes the creation of this Boolean-based branch.