You create an enumerated domain that allows policy managers
to select a car rental branch.
About this task
You can make the vocabulary more specific by
giving policy managers a way to select values in a domain. For this
tutorial, you create an enumerated domain of literals in the BOM from
which policy managers select car rental branches from a drop-down
list.
Procedure
- Create an enumerated domain of branches:
- In the Rule Explorer view, double-click the BOM entry model.
- In the Outline view, click the attribute Branch.state.
- In the Domain section of the Member page, click Create
a domain.
- In the Domains wizard, select Literals,
and then click Next.
- Click Add.
The list of literals displays a newValue field.
- Overtype newValue with New York, and then press Enter.
- Use the Add button to add these
values:
- Rhode Island
- New Hampshire
- Massachusetts
- Click Finish, and then save your work.
The Domain section now lists the values in the domain.
Now you write a rule to test this domain.
- Write an action rule that uses the domain defined for the state member:
- In the rules folder, create an
action rule named BranchInfo.
- In the Content section of the Intellirule editor, type if, and then press Enter.
- Type the following phrase:
the state of the branch is one of { "Massachusetts"}
- Place the cursor immediately after "Massachusetts", and then type
a comma followed by the Spacebar. The Content Assist box shows the
list of constants defined in the enumerated domain.
- From the Content Assist box, select "New Hampshire".
- Finish writing the rule to produce the following:
if
the state of the branch is one of { "Massachusetts" , "New Hampshire" }
then
display the message "The branch is in the state of Massachussets or New Hampshire" in the session;
- Save your work.
You
now have a rule project with a vocabulary set up for efficient rule
editing.
For more information on using the rule editors, see Working with action rules.
Results
You have completed the Defining a vocabulary
tutorial, and learned how to set up a vocabulary for rule editing.