ILOG JRules User Guide > Creating Rule Projects > Getting Started > Tutorial: Defining a Vocabulary > Step 6: Create a Domain

A way to make the vocabulary more specific is to allow policy managers to select values in a domain. You can create an enumerated domain of literals in the BOM to allow policy managers to choose the car rental branch from a drop-down list.

To create an enumerated domain for branches:

  1. In the Outline view, click the attribute Branch.state.
  2. In the Domains section of the Member page, click Create a domain.
  3. The Domain dialog opens.
  4. In the Domain type field, select Literals.
  5. Click Add.
  6. A newValue field appears the list of literals.
  7. Overtype newValue with New York, then press ENTER.
  8. Add the values Rhode Island, New Hampshire, and Massachusetts to the enumeration of literals.
  9. Click OK, and save your work.
  10. The values in the domain are now listed in the Domain section.
    Enumerated Domain of Literals

You now need to write a rule to test this domain.

To write a business rule that uses the domain:

  1. Directly in the rules folder, create a business rule named BranchInfo.
  2. In the Code section of the Intellirule Editor, type if and press ENTER.
  3. Type:
   the state of the branch is one of  {
The Content Assist box shows the list of constants defined in the enumerated domain.
  1. Finish editing the rule in order to get the following result:
if 
   the state of the branch is one of { "Massachusetts" , "New Hampshire" }
then
   display the message "The branch is in Massachusetts or New Hampshire" 
                                           in the session;
  1. Save your work.
  2. You now have a rule project with a vocabulary set up for efficient rule editing.

Congratulations! Congratulations!  
You have completed this tutorial and learned how to set up a vocabulary for rule editing. 

Related Concepts

Overview: A Vocabulary for Rule Editing
Business Object Model (BOM)
Execution Object Model (XOM)
BOM and XOM
Vocabulary

Related Tasks

Working With Business Elements
Defining a Vocabulary
Defining How Business Elements Map to the XOM

Related Reference

BOM Editor

Related Samples and Tutorials

Tutorial: Creating Business Rules