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
- 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.
-
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.
-
Define the first condition column:
- Double-click the letters in the first column header.
- Enter the title State.
-
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> - Click OK.
-
Define the second condition column:
- Double-click the letters in the second column header.
- Enter the title Age of the customer.
-
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> - Click Apply, and then enter the subcolumn titles Minimum Age and Maximum Age by selecting each entry in Expression Placeholders.
- Click OK.
- Delete the third column by right-clicking its header and clicking Delete in the menu.
-
Define the first action column:
- Double-click the letters in the third column header.
- Enter the title Rental Rejected.
-
In the edit bar, make the relevant selections to create the action:
make it <a boolean> that 'the current rental agreement' is rejected - Click OK.
-
Create and define a second action column:
-
Right-click the header of the
Rental Rejectedaction column, and then click Insert column > Action after.A new action column is added to the decision table.
- Double-click the letters in the forth column header.
- Enter the title Reason.
-
In the edit bar, make the relevant selections to create the action:
in 'the current session', display the message : <a string> - Click OK.
-
Right-click the header of the
-
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
Statecolumn. - 18 for
Minimum Ageand 21 forMaximum Age. - true for the
Rental Rejectedcolumn.
In row 2, enter the following details:
- New York for the
Statecolumn. - 21 for
Minimum Ageand 25 forMaximum Age. - false for the
Rental Rejectedcolumn.
- New York for the
- Save your work.
What to do next
In the next task, you enter data into the decision table by generating lines automatically.