ILOG Rules for .NET User Guides > ILOG Rule Team Server for SharePoint > Tutorial: Editing Decision Tables

This tutorial explains how to use Rule Team Server to edit decision tables, including:

images/tms_time.png You need about 20 minutes to complete this tutorial.

Once you have checked out the Decision Table of the tutorial, you have the option of carrying out an equivalent tutorial in the ILOG Rule Solutions for Office environment. Consult the Tutorial section of the ILOG Rule Solutions for Office online help for more information.

Note
You must have the ILOG Rules Tutorial Page entry in the Shared Documents document library to do this tutorial. If this entry is not available, contact your Rule Team Server Administrator.

Scenario

This tutorial uses the example of a car rental agency, EU-Rent Car Rental. The business rule application needs to handle rapidly evolving business policies that govern car rentals. For example, eligibility for car rentals depends on the age of the client. EU-Rent needs to keep track of the age limit policies for its branches across the United States, which vary from state to state.

This tutorial explains how to modify the rules used for determining rental eligibility.

Note
The scenario for this tutorial is inspired by the EU-Rent Car Rental use case specification, produced by the Business Rules Group (http://www.businessrulesgroup.org/brghome.htm).

Step 1: Checking Out and Opening the Eligibility RuleDoc

In this step, you open and become familiar with the contents of a sample RuleDoc.

  1. In the Shared Documents document library, click ILOG Rules Tutorial Page.
    Note
    If the ILOG Rules Tutorial Page entry is not available, contact your Rule Team Server Administrator.
  2. This displays the ILOG Rules Tutorial Page, which contains the rule document library as well as a RuleDoc Browser, Rule Editor, and Rule Property Editor.
  3. In the rule document library, place your cursor on the Eligibility RuleDoc name and click the arrow to the right so that the drop-down list appears, select Check Out and then click OK.
  4. This locks the document for editing. No one else can modify the document until you check it back in.
  5. Select the Eligibility RuleDoc option button.
  6. The RuleDoc Browser lists the available decision tables in the RuleDoc Browser. The AgeCheck decision table is selected automatically.
  7. Click the Disable Paging Mode icon in the ILOG Rule Editor toolbar.
  8. Paging Mode is useful when you have especially large decision tables, since it prevents the creation of excessively long web pages. Disabling it in this case, as the decision table is relatively short, means you do not need to scroll between pages within the Rule Editor.

Step 2: Editing Decision Table Values

Each row in the decision table is equivalent to a rule. To make decision tables more intuitive to read, cells that are shared by more than one rule are displayed as merged. Depending on the values required by the column, you modify the contents of a cell by either selecting values from a predefined list or typing directly.

In this step, you modify the three rules used to calculate eligibility for rentals in New Hampshire.

To update values in a decision table
  1. In the Decision Table Editor, locate the rules for New Hampshire and in the Age column change the Min value from 23 to 21 and the Max value from 70 to 75.
    Note
    To change a value, click directly on the value in the cell, type in the new value in the field, and then press ENTER.
  2. Change the Age values in the rows above and below, from 22 to 20, and from 71 to 76 respectively.

The three rows for New Hampshire now translate into these rules, which you can view by clicking the row numbers (4, 5, and 6).

 If
    all of the following conditions are true:
       the state of the pickup branch of the rental agreement is New Hampshire
       the age of the current customer is at most 20 
 Then
    set the rental agreement accepted status to False
    display the message: The customer's age is below the minimum for rentals in New 
Hampshire.
 If
    all of the following conditions are true:
       the state of the pickup branch of the rental agreement is New Hampshire
       the age of the current customer is between 21 and 75 
 Then
    set the rental agreement accepted status to True
    display the message: The customer is eligible to rent in New Hampshire.
 If
    all of the following conditions are true:
       the state of the pickup branch of the rental agreement is New Hampshire
       the age of the current customer is at least 76 
 Then
    set the rental agreement accepted status to False
    display the message: The customer's age is past the maximum for rentals in New 
Hampshire.

Step 3: Adding and deleting rows

In this step, you add an otherwise row and delete the rules for Rhode Island from the business policy.

Note
Changes to the conditions and actions that govern the columns can only be edited in ILOG Rule Solutions for Office or ILOG Rule Studio for .NET.

To add rows
  1. In the last row of the table, click the arrow beside the state name, and then click Insert otherwise row.
  2. In the Age column, click the first cell (Min), type 21 and then press ENTER.
  3. A red exclamation mark appears in the cell because you need to change the operator. You can consult the Problem list below the table for a detailed error message.
  4. Click the cell, and then, in the Change local operator drop-down list just below the table, select <.
  5. In the Accepted column, select False from the drop-down list.
  6. In the Message column, click the cell, type The customer's age is below the minimum for rentals, and then press ENTER.
  7. In the Age column, click the arrow beside 21 and then click Insert row after.
  8. The cell from which a row is added dictates the structure of the added row. You should now have two rows sharing the Otherwise column.
  9. Fill in the rule with the following values:
To delete rows

Step 4: Modifying the table view

The Decision Table Editor provides several features that enable you to change the way the information is displayed in your decision table, including:

In this step, you sort the table by state and contract the first set of rows, then go on to display the business rule for a given row and the condition or action statements for a given column.

To sort the table by State
To contract a set of entries

The rows shared by that state are contracted and hidden in the table.

To expand the rows again, click the plus (+) button.

To display the business rule for a given row
To display condition or action statements

Step 5: Quitting the tutorial

  1. In the rule document library, place your cursor on the Eligibility RuleDoc name and click the arrow to the right so that the drop-down list appears.
  2. Click Discard Check Out.
    Note
    Normally, you would select Check In to save your modifications. However, for the purposes of this tutorial, you can discard changes to prevent overwriting the original document.
  3. Click OK to confirm.