< Previous | Next >

Task 2: Verbalizing new business elements

You learn how to update the BOM entry, verbalize your business elements and generate automatic variables.

About this task

You now need to update the BOM entry to include the missing classes, but you do not want all of them to be verbalized automatically.

Step 1: Updating the BOM entry

You update the BOM entry to include the missing classes.

Procedure

  1. In the Rule Explorer view, expand the bom folder, right-click the model, and then select BOM Update.
  2. In the BOM Update view, clear all the check boxes to deselect all the classes, and then select the following XOM classes:
    • Branch
    • CarGroup
    • Offer
    • Session
  3. Expand Differences and Actions, select Bulk: Import XOM Class (4) from the Actions list, and then click Perform and save to import the four XOM classes.

    When the build is complete, the Verbalize BOM dialog opens.

  4. In the Verbalize BOM dialog, select the method Session.displayMessage. Leave the other selections as they are.
  5. Click Finish.
  6. In the BOM Editor (which displays the BOM entry), expand the package to see the verbalization of the new elements. The Vocabulary view also shows the new elements. To open the Vocabulary view, go to the Window menu and select Show View > Vocabulary.

    In the BOM Editor, the classes you updated have been added to the BOM entry, and the warnings should have disappeared from the Problems view.

Step 2: Generating automatic variables

In the car rental policy rules, you need to declare variables as instances of BOM classes. To avoid having to declare these variables in each rule, you can generate automatic variables. Automatic variables are variables that you declare as an instance of a specific BOM class. Then, they are accessible from all the business rules in the rule project.

Procedure

  1. In the Outline view, click the class Branch.
  2. In the BOM Editor, in the Class Verbalization section, select Generate automatic variable.
  3. Repeat these steps for each class in the carrental package.
  4. Save your work. Automatic variables are now defined for all the classes of the BOM.

What to do next

In the next task, you create a rule package and use the Intellirule editor to create an action rule to test your vocabulary.
< Previous | Next >