You add several action rules to a decision table, and define the rules with the Business
Action Language (BAL).
About this task
In this task, you write five action rules and put them into the relevant packages. You can write
rules in Rule Designer or in Decision Center. If you work in Decision Center, synchronize the decision service with
Rule Designer before you begin.
You create the following rules in the
eligibility and
validation packages.:
| Package name |
Rule name |
| eligibility |
MinimumNetIncome
|
| validation |
MaximumAgeReq
MaximumAmount
|
Procedure
-
Create the MinimumNetIncome rule:
-
In the rule project, right-click the eligibility package and then click .
-
In the Name field, type MinimumNetIncome.
-
Click Finish.
The Rule Explorer view displays the new action rule and the Intellirule editor opens.
-
Write the MinimumNetIncome rule as follows:
if
the income after tax of 'the borrower' is less than 24000
then
add "The yearly income is lower than the basic request"
to the messages of 'the loan' ;
reject 'the loan' ;
-
In the validation package, add the following rules:
| Name |
Rule |
| MaximumAgeReq |
if
the age of 'the borrower' is more than 65
then
add "The age exceeds the maximum." to the messages of 'the loan' ;
reject 'the loan' ;
|
| MaximumAmount |
if
the amount of 'the loan' is more than 1000000
then
add "The loan cannot exceed 1000000" to the messages of 'the loan' ;
reject 'the loan';
|
- Right-click the eligibility package and then click
.
- In the dialog, type the name RepaymentAndScore and then click
Finish.
The decision table opens in the default editor. The
table shows three empty condition columns, and one empty action column.
- Define the first condition column:
- Right-click the header of first column, and then enter the title debt to
income.
- Enter the following condition test in the edit bar:
the yearly repayment of 'the loan' * 100 / the yearly income of 'the borrower' is at least <min> and less than <max>
- Click OK.
- Define the second condition column:
- Right-click the header and enter the title credit
score.
- Enter the following condition test:
the credit score of 'the borrower' is at least <min> and less than <max>
- Click OK.
- Delete the third condition column by right-clicking the column header and selecting
Delete from the menu.
- Define the first action column:
- Right-click the header of the first action column and enter the title
message.
- Enter the following action:
add <a string> to the messages of 'the loan'
- Click OK.
- Create and define a second action column:
- Right-click the header of the message column and click
.
- Right-click the header of the new column, and enter the title
rejected.
- Enter the following action:
- Click OK.
- Fill rows 1 to 7 with the following data:
| Debt to income |
Credit score |
Message |
Rejected |
| 0 |
30 |
0 |
200 |
Debt-to-income too high compared to credit score |
|
| 0 |
30 |
200 |
800 |
|
|
| 30 |
45 |
0 |
400 |
Debt-to-income too high compared to credit score |
|
| 30 |
45 |
400 |
800 |
|
|
| 45 |
50 |
0 |
600 |
Debt-to-income too high compared to credit score |
|
| 45 |
50 |
600 |
800 |
|
|
| |
|
0 |
800 |
Debt-to-income ratio is greater than 49 |
|
Tip: You can copy and paste the data in the first cell of the decision table.
- Fill row 7 debt to income values:
- Right-click row 7 underneath the min column, and click
Operator.
- Click ≥ for more than and equal to.
- Type 50, press Enter.
- Disable actions in selected rows:
- Right-click row 2 within the message column, and click
Disable. A red disable symbol is displayed.
- Do the same for rows 4 and 6 in the message column.
- Right-click row 2 within the reject column, and click
Disable. A red disable symbol is displayed.
- Do the same for rows 4 and 6 in the reject column
- Format debt to income column:
- Right-click the header of the column.
- Click Format column.
- Enter the following format {0, number, #0.##} .
- Click OK to save your changes.
- Save your work.