You create two run configurations to see the results of
applying sample loan request data on the decision operations.
About this task
The decision operation defines the ruleset that is deployed.
It also defines the input and output parameters that are used to exchange
information between the ruleset and the client application. You test
the decision operation by using a run configuration that submits values
for the input and output parameters.
Procedure
- Start by running one of the existing run configurations,
called run scoring. This run configuration uses a
decision operation that is located in the Loan Validation
Scoring project. The scope of this decision operation is
the rules of that project only. This run configuration can be used
to test one part of the overall decision service:
- Click .
- Click Decision Operation > run
scoring.
- Click Run. The Console shows that the calculated
score is 300.
- Create a run configuration for the loan validation
with score and grade decision operation:
- Click .
- Right-click Decision Operation and select New.
- Enter the name run loan validation as the
name of the run configuration.
- Browse to Loan Validation Service, select loan
validation with score and grade, and click OK.
- Click the Parameters & Arguments tab.
- Select borrower and click Edit Value to
define the parameters.
- Select Function body, replace the existing
code with the following, and click OK:
java.util.Date birthDate = loan.DateUtil.makeDate(1950,1,1);
loan.Borrower borrower = new loan.Borrower("Smith","John",birthDate, "123121234");
borrower.zipCode = "12345";
borrower.creditScore = 200;
borrower.yearlyIncome = 20000;
return borrower;
- Do the same for the loan parameter and enter
the following code:
java.util.Date loanDate = new java.util.Date();
loan.LoanRequest loan = new loan.LoanRequest(loanDate,48,100000,1.2);
return loan;
- Click Apply to commit your changes.
- Click Run. The Console shows the following
results:
...
Too big Debt/Income ratio: 1.40
We are sorry. Your loan has not been approved.
- Create a second run configuration for the loan validation production decision
operation by duplicating the first one, and then modifying it:
- Click .
- Right-click Decision Operation > run loan
validation and select Duplicate. The run configuration uses the
same parameter values.
- Enter the name run deployment as the name of the run configuration.
- Browse to Loan Validation Service, select loan validation
production, and click OK.
- Click Apply to commit your changes.
- Click Run. The Console shows the following
results:
...
Report: Valid data true Approved true
- Insurance required true Insurance rate 2%
What to do next
In the next task, you create deployment configurations
for the decision service and use them to deploy rulesets.