In our scenario, we want to approve the loan if the loan
amount is less than $50 000. In addition, we want to allow changes
to the loan amount threshold after the rules have been deployed to
the runtime environment.
To do that, we need to first define a rule template, which
we will then extend a rule instance from, by completing the following
steps:
- Click the Add If-Then Template icon
under Templates, and call the new template AutoLoanApproval.
- Add a parameter named LoanValue of
type int.
- In the Presentation field, type a statement that the administrator
will use to configure the LoanValue at run time. In this case, the
AutoLoanApproval rule will return true if the LoanAmount is less than
or equal to LoanValue, so type Approved if loan amount
is <=.
- Click in the Presentation field
and select LoanValue from the list.
- To check if the loan amount is less than the threshold,
click Condition expand AutoApprovalInput and
select LoanAmount. Select the less than or
equal to symbol, <=, then select LoanValue.
- To set the response, click Action and
select AutoApprovalResponse. Select the equals
sign, =, then select true.
- Press enter and type return. The
rule template should look like the one in the following screen capture:
- Under the Rules section, select Add Template
Rule and then select the newly created rule template,
AutoLoanApproval.
- In the input box type 50000.
- To ensure "false" is returned when the LoanAmount
is higher than the amount that is specified in the LoanValue rule,
add an Action rule and configure it as shown in the following screen
capture:
- The rule set editor, with all the rules configured is shown
in the following image:
- Save and close the Business Rules and Rule Group editors.