In the example, four US states each have specific rules defined. Processing
policy might require graceful rejection of requests that do not specify one of these four
states. And, over time, the included states might expand or contract. This branch for State
Specific Rules will be created as a separate Ruleflow, State
Rules, so that it can be reused in other Ruleflows.
To create a branch on a Ruleflow canvas for an attribute
that is an enumerated list:
On the Ruleflow canvas, click Branch on the
Palette, and then click on the canvas where you want to place the branch. A Branch
compartment is created with your cursor in the name label area.
Enter a name such as State Specific
Rules, and press Enter.
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.
Choose Applicant.state. The list of
all US state abbreviations that is used by this attribute defines the enumeration in the
Vocabulary, as shown:
Note: See Enumerations for information about
entering or pasting enumeration labels and values as well importing them from a
connected database.
Drag the Rulesheets California.ers, Idaho.ers, Texas.ers,
Vermont.ers, and Other
States.ers into the branch compartment on the canvas. You can use CTRL+click to select multiples and then drag them as a group.
Each Rulesheet is marked with a error flag at this point, as shown:
On the canvas, click the branch to open its Properties tab. You can define the enumeration branches in a few ways:
Click the Value drop-down list. On
separate value lines, choose each of the defined states and then other.
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 each one is bound to a node.
Click a state value, then use the drop-down list to select the
appropriate node. In the following image, notice that the California node was assigned
to the CA value, so that value turned black. The node on the canvas cleared the error,
and the branching value is indicated in parentheses.
Note: An additional
node was added to the canvas, but because it is connected to a node, it is not
offered in the drop-down list as a branch.
After matching the states with appropriate nodes, the Other States Rulesheet is unassigned. To handle this, a
special purpose value is added. At the bottom of the value list, click the down arrow
and choose other. Assign the Other States Rulesheet to that
value.
After all the nodes are assigned to values, click Cleanup to clear all the unassigned values, as shown: The unassigned values that were removed will all be handled by the other value's node. If you click Check
for Completeness now, you get that the branch is complete.
That completes the creation of this enumeration-based branch.
Note: Other features of the user interface for
defining branch activity are:
Clicking a trashcan button on the right side of a branch line
deletes that line.
Clicking the Clear button removes all lines.
The branch and components on the canvas are not removed.
The Extend to Database option is offered when
the branching attribute is defined to connect to a database table and columns. The
option is enabled in the Vocabulary editor by setting the attribute's Entity property
Datastore Persistent to Yes.
Choosing the option when it is available pulls the entities out of the defined and
connected database and then processes the branch; when cleared, it tests against only
the payload.