< Previous | Next >

Task 3: Testing the ruleset

You test the ruleset in the Rule Execution Server console.

About this task

You test a ruleset, and monitor the decision service by using the Decision Warehouse.

Step 1: Enabling Decision Warehouse tracing

About this task

You enable tracing in Decision Warehouse.

Procedure

  1. In the Navigator, expand RuleApps/loanvalidation_for_resruleappmngt/1.0 and click loan_validation_with_score_and_grade/1.0 to open the ruleset view.
  2. In the Ruleset View, click Show Monitoring Options.
  3. Click Edit next to Tracing in Decision Warehouse is currently disabled.
  4. Select Enable tracing in Decision Warehouse.
  5. Click Save.
  6. Click Show Properties. You see the properties that enable monitoring in Decision Warehouse.

Step 2: Testing the ruleset

About this task

You use the REST test interface to enter ruleset parameter values and call a deployed ruleset.

Procedure

  1. In the Ruleset View, click Retrieve HTDS Description File.
  2. Choose REST as the service protocol type, and OpenAPI-JSON as the format.
    Image shows the ruleset view.
  3. Click Test.
  4. On the REST Service page, replace the code to request a loan for the amount of 999:
    {  
    "loan": {    
    "numberOfMonthlyPayments": 180,
    "startDate": "2016-10-19T17:27:14.000+0000",    
    "amount": 999,
    "loanToValue": 0.9  
    },   
    "borrower": {    
    "firstName": "Joe",
    "lastName": "Doe",    
    "birth": "1987-09-29T01:49:45.000+0000",    
    "SSN": {      
    "areaNumber": "424",      
    "groupCode": "56",
    "serialNumber": "7942"    
    },    
    "yearlyIncome": 50000,    
    "zipCode": "95372",    
    "creditScore": 6000,    
    "latestBankruptcy": {      
    "date": "2014-09-18T23:18:33.000+0000",      
    "chapter": 3,      
    "reason": "Summer loss"    
    }  
    }
    }    
  5. Click Execute Request.
  6. Check the Server Response, which shows the following message:
    ...    
    "approved": true,    
    "messages": [      
    "Very low risk loan",      
    "Congratulations! Your loan has been approved"
    ...

    This is not what you expected because your loan amount is too low. In the next step, you look for more information in Decision Warehouse.

Step 3: Viewing the decision result in Decision Warehouse

About this task

You use Decision Warehouse to find more details about the decision.

Procedure

  1. On the Decision Warehouse tab, click Search on the Search Decisions page.
  2. On the entry that is found, click View decision details.
  3. On the Execution Details page, in the Decision Trace section, expand Ruleflow Tasks > loanvalidation > validation. You can see that the checkAmount rule was not fired, and then the computation was run. In the Input Parameters section, you can see the amount of the loan:
    <amount>
    <int>999</int>
    </amount>
    In the Execution output section, you see Report: Valid data true Approved true.
  4. Close the Execution Details page.
  5. Select Clear Decisions. Leave all fields empty, and click Clear.

    Confirm that you want to remove all traces from the Decision Warehouse database.

    By examining the execution details, you know that the checkAmount rule was not run for a loan with the amount of 999. You need to use another RuleApp that has a correct checkAmount rule.

What to do next

In the next task, you deploy the correct rule.
< Previous | Next >