| ILOG JRules User Guide > Creating Rule Projects > Getting Started > Tutorial: Defining a Vocabulary > Step 1: Create a BOM Entry |
Step 1: Create a BOM Entry |
PREVIOUS NEXT |
In this tutorial, you follow a bottom-up approach to creating a vocabulary in Rule Studio. This means that you use existing application objects as the basis for your vocabulary. For this purpose, we have provided a Java project that models car rental concepts.
In this step you will:
Before you start, you need to import the Java project into your Eclipse workspace.
| Note |
| If you have imported the answer projects for the tutorial, close or delete them before importing the start projects. |
To import the Java project:
carrental-xom from the shared directory:
You are going to use this Java project as the Execution Object Model (XOM), which is the basis of the Business Object Model (BOM) for rule editing.
To store and organize the BOM and rule artifacts, you need to create a rule project.
To create the rule project:
vocabulary-rules. Click Next.
carrental-xom.
During this tutorial, you will write the following rules:
Business Rule Loyalty.AwardLoyalty
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;
Business Rule Eligibility.UnderAge
if the age of the customer of the rental agreement is less than 18 then make it true that the rental agreement is rejected; display the message "The rental agreement is rejected";
Business Rule BranchInfo
if
the state of the branch is one of { "Massachusetts" , "New Hampshire" }
then
display the message "The branch is in Massachusetts or New Hampshire" ;
Now you need to create a BOM entry and verbalize the elements of the vocabulary that are required to edit these rules. Verbalizing is the process of associating terms and phrases to elements of the BOM.
To create the BOM entry:
vocabulary-rules, and click New > BOM Entry.
model in the Name field and select the Create a BOM entry from a XOM option. Click Next.
carrental-xom.Click OK.
carrental package and select the classes Customer and RentalAgreement.
The classes you added to the BOM entry include references to other classes that are not in the BOM entry. Although not all the members of these classes need to be verbalized, they need to be included in the BOM entry. You will fix this problem in the next Step of the tutorial.
Before you go and fix the warnings, take a minute to look at the default verbalization of the classes in the BOM entry.
To look at the verbalization:
carrental package and double-click the class Customer.
customer.
firstName.
{first name} of {this}.
In the next Step of the tutorial, you will fix the warnings by updating the BOM entry to include the missing classes, and verbalize some new elements.
Next: Step 2: Verbalize New Business Elements
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |