Task 3: Testing the ruleset

You test the ruleset in the Rule Execution Server console.

About this task

In this task you do the following work:
  • Enable tracing on a ruleset.
  • Test the ruleset by using representative data.

Step 1: Enabling Decision Warehouse tracing

You enable tracing in Decision Warehouse.

Procedure

  1. In the navigator tree, expand RuleApps/test_deployment/1.0 and click loan_validation_with_score_and_grade/1.0 to open the ruleset view.
  2. Expand the Decision Warehouse Options section.
  3. Use the toggle to enable tracing.
    The toggle can be used to enable or disable tracing. Tracing is disabled by default.
  4. Observe the properties.

Step 2: Testing the ruleset

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

Procedure

  1. Click Test Ruleset.
  2. Select JSON in the Execution Request menu.
  3. 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"    
    }  
    }
    }    
  4. Click Execute Request.
  5. 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.

  6. Close the REST Service tab and the Retrieve HTDS Description File window.

Step 3: Viewing the decision result in Decision Warehouse

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

Procedure

  1. On the Decision Warehouse tab, click Search on the Search Decisions view.
  2. On the entry that is found, click the Decision ID.
  3. On the Execution Details view, in the Execution Events 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 view.
  5. Open the Clear Decisions tab. 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.