ILOG JRules User Guide > Creating Rule Projects > Getting Started > Tutorial: Defining a Vocabulary > Step 3: Test the Vocabulary in a Business Rule

It is recommended that you store your rule artifacts in rule packages, not directly in the rules folder.

To create a rule package:

  1. Select the rules folder and, on the File menu, click New > Rule Package.
  2. In the New Rule Package wizard, in the Package field, type Loyalty.
  3. Click Finish.
  4. The new rule package appears in the Rule Explorer view.

You are now going to create a business rule that uses the vocabulary related to customers and rental agreements.

To create a business rule:

  1. Right-click the Loyalty package and click New > Business Rule.
  2. In the New Business Rule wizard, in the Name field, type AwardLoyalty. Click Finish.
  3. The new business rule appears in the Rule Explorer view, and the Intellirule Editor opens.

In the Intellirule Editor, type the contents of the rule in the Code section using the Content Assist mechanism, as follows.

To edit the business rule:

  1. In the Code section of the Intellirule Editor, type if and press ENTER.
  2. On the next line, press CTRL+SPACEBAR to activate the Content Assist box.
  3. In the Content Assist box, select the duration of <a rental agreement> and press ENTER.
  4. In the Content Assist box, select the automatic variable the rental agreement and press ENTER.
  5. Select is more than and press ENTER.
  6. Type 20 and press ENTER.
  7. Type then and press ENTER.
  8. Continue editing the rule to have the following result:
if
   the duration of the rental agreement is more than 20
then
   make it true that the customer of the rental agreement 
                                is loyalty program member; 
  1. Save your work.

In the next Step of the tutorial, you will see how to extend the vocabulary with business elements that do not exist in the XOM, but can be mapped to it.

Next Next: Step 4: Extend the Business Object Model