Task 2: Creating the MinimumAge decision table

You create the MinimumAge decision table that is used in this tutorial.

About this task

You create a decision table that defines the eligibility rules for drivers. The rules are based on minimum age.

Procedure

  1. In the Rule Explorer, in the rule project decisiontable-rules-start, right-click the eligibility package in the rules folder, and then click New  > Decision Table.
  2. In the dialog, type the name MinimumAge, and then click Finish.

    The decision table editor opens, showing a blank decision table with three empty condition columns and one action column.

  3. Define the first condition column:
    1. Double-click the letters in the first column header.
    2. Enter the title State.
    3. In the edit bar, make the relevant selections to create the following condition test:
      the state of the pickup branch of 'the current rental agreement' is <an object>
    4. Click OK.
  4. Define the second condition column:
    1. Double-click the letters in the second column header.
    2. Enter the title Age of the customer.
    3. In the edit bar, make the relevant selections to create the following condition test:
      the customer's age of 'the current rental agreement' is at least <min> and less than <max>
    4. Click Apply, and then enter the subcolumn titles Minimum Age and Maximum Age by selecting each entry in Expression Placeholders.
    5. Click OK.
  5. Delete the third column by right-clicking its header and clicking Delete in the menu.
  6. Define the first action column:
    1. Double-click the letters in the third column header.
    2. Enter the title Rental Rejected.
    3. In the edit bar, make the relevant selections to create the action:
      make it <a boolean> that 'the current rental agreement' is rejected
    4. Click OK.
  7. Create and define a second action column:
    1. Right-click the header of the Rental Rejected action column, and then click Insert column > Action after.

      A new action column is added to the decision table.

    2. Double-click the letters in the forth column header.
    3. Enter the title Reason.
    4. In the edit bar, make the relevant selections to create the action:
      in 'the current session', display the message : <a string>
    5. Click OK.
  8. Create two rows in the table to represent rules by entering data into the table cells:
    In row 1, enter the following details:
    • New York for the State column.
    • 18 for Minimum Age and 21 for Maximum Age.
    • true for the Rental Rejected column.

    In row 2, enter the following details:

    • New York for the State column.
    • 21 for Minimum Age and 25 for Maximum Age.
    • false for the Rental Rejected column.
  9. Save your work.

What to do next

In the next task, you enter data into the decision table by generating lines automatically.