Task 3: Creating run configurations for the decision operations

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.

Step 1: Running a run configuration

You start by running one of the existing run configurations, called run scoring. This run configuration uses a decision operation that is 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.

Procedure

  1. Click Run > Run Configurations.
  2. Click Decision Operation > run scoring.
  3. Click Run. The Console shows that the calculated score is 300.

Step 2: Creating a run configuration

You create a run configuration for the loan validation with score and grade decision operation.

Procedure

  1. Click Run > Run Configurations.
  2. Right-click Decision Operation and select New.
  3. Enter the name run loan validation as the name of the run configuration.
  4. Browse to Loan Validation Service, select loan validation with score and grade, and click OK.
  5. Click the Parameters & Arguments tab.
  6. Select borrower and click Edit Value to define the parameters.
  7. Select Function body, replace the existing code with the following code, 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;
    
  8. 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;
    
  9. Click Apply to commit your changes.
  10. Click Run. The Console shows the following results:
    ...
    Too big Debt/Income ratio: 1.40
    We are sorry. Your loan has not been approved.
    

Step 3: Creating a second run configuration

You create a second run configuration for the loan validation production decision operation by duplicating the first one, and then modifying it.

Procedure

  1. Click Run > Run Configurations.
  2. Right-click Decision Operation > run loan validation and select Duplicate. The run configuration uses the same parameter values.
  3. Enter the name run deployment as the name of the run configuration.
  4. Browse to Loan Validation Service, select loan validation production, and click OK.
  5. Click Apply to commit your changes.
  6. 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.