< Previous | Next >

Task 2: Changing the preconditions and the rules

You update the preconditions that test the data that is sent to the decision table. You also change the cell values of the conditions and actions in rules.

About this task

You add a precondition that tests the borrower's age, and then you add values to the new rows in the decision table.

Step 1: Changing the preconditions

About this task

You use preconditions to test incoming data for a decision table. The rules in a decision table cannot process data that fails the preconditions.

Currently, the table only has one precondition, which tests data for a grade value:

if
	'the grade' is not empty

You add a test to check that the borrower is at least 18 years old.

Procedure

  1. Click Preconditions.
  2. Use the rule editor to add the following statement to the preconditions:
    and the age of 'the borrower' is at least 18 
  3. Click Update to save your changes, and close the dialog box.

    The preconditions now contain the following statement:

    if
    	'the grade' is not empty
     	and the age of 'the borrower' is at least 18
    The decision table processes a loan request if the data includes a loan grade, and the borrower is at least 18 years old. The preconditions test the data before each rule in the table is run.

Step 2: Changing the grade cells in the new rows

About this task

The rules in the decision table share the rule statement, but they vary in their conditions and actions. You update the rows that you made in Task 1 to complete the rules for the new grade. You start by changing one value and copying it to several cells, and then you update rules with new values and variables.

Procedure

  1. Click the Grade cell in row 13.
  2. Double-click the cell, replace the existing value by D, and then press Enter.
  3. Right-click the cell, and click Copy.
  4. Select the Grade cells of rows 14 to 16.
  5. Right-click the selected cells, and click Paste to change their values from C to D.
  6. Right-click cell 14 and click Copy.
  7. Right-click cell 15 and click Paste.

Step 3: Adding values to the condition columns

About this task

You add values to the condition columns.

Procedure

To :

  1. Double-click the Age cell in row 1. The Min cell opens. Type 30 as the minimum value.
  2. Click the other subcell (Max). Type 65 as the maximum value.
  3. Repeat steps 1 and 2 to add 25 and 29, 21 and 24, and 18 and 20 to the Age cells of rows 5, 9, and 13, respectively.
  4. Right-click the Age cell in row 1, and click Copy.
  5. Select the Age cells of rows 2 to 4.
  6. Right-click the selected cells, and click Paste.
  7. Repeat steps 4 - 6 with the Age cells in grades B, C, and D.
  8. Change the Amount of loan cells for rows 13 and 14 to the following values:
    • Row 13: 100,00A
    • Row 14: Max: 200,000
  9. Right click the Amount of loan cell in row 13, and click Change operator > <. The operator include values less than 100,000.
  10. Right click the Amount of loan cell in row 14, and click Change operator > [..[. The operator include values from 100,000 to 199,999, but it does not include 200,000.
    Note: These changes add errors that you correct in the next task.

Step 4: Completing the action columns

Procedure

  1. Click the Insurance rate cell for row 13, and change the value to 0.006.
  2. Repeat step 1 for the rest of the grade D Insurance rate cells:
    • Row 14: 0.085
    • Row 15: 0.0145
    • Row 16: 0.0200

What to do next

In the next task, you use content checking to solve problems in the decision table.
< Previous | Next >