< Previous | Next >

Task 2: Creating the MinimumAge decision table

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

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. Right-click the header of column A, and then click Edit Condition Column.
    2. Enter the title State.
    3. 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. Right-click the header of column B, and then click Edit Condition Column.
    2. Enter the title Age of the customer.
    3. 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 column C by right-clicking its header and clicking Remove Condition Column.
  6. Define the first action column:
    1. Right-click the header of the action column, which is now column C, and then click Edit Action Column.
    2. Enter the title Rental Rejected.
    3. 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 Action Column After.

      A new action column, named D, is added to the decision table.

    2. Right-click the header of column D, and then click Edit Action Column.
    3. Enter the title Reason.
    4. 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.

    The completed decision table looks like the following table:

    Rule Explorer showing MinimumAge decision table with two rows in the table
  9. Merge the two New York cells by selecting them, right-clicking the selected cells, and then clicking Merge.
  10. Save your work.

What to do next

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

< Previous | Next >