< Previous | Next >

Task 7: Running the scorecard application in your rule project

You learn how to run the scorecard application in a rule project and view the assessment report.

About this task

In this task, you run the scorecard directly in your rule project. This task demonstrates how you can use the exported scorecard technical rules as independent rule artifacts.

Procedure

To run the exported RiskScorecard:

  1. In the Rule Explorer view, expand scorecardpublish_tutorial > rules > rulePackage and then double-click businessRule.

    The view for the selected business rule opens in the Rule Designer editor area.

  2. In the Content area, add the following action to the business rule:

    then print RiskScorecard;

    Note:

    Enter the command in the highlighted line at the top of the Content area. Intellirule displays errors if the command is entered in the wrong place.

  3. In the Rule Explorer view, expand scorecardpublish_tutorial > rules > rulePackage, and double-click mainRuleflow to create the following ruleflow:
    Ruleflow diagram
  4. Double-click mainRuleFlow under scasharedBOM_tutorial to open the Properties view.
  5. Set the value of the main flow task property to false.
  6. Save your changes.
  7. From the Run menu, click Run Configurations.

    Alternatively, you can click Run on the Rule Designer toolbar.

  8. In the side pane of the Run window, select Rule Project > scorecardpublish_tutorial.
  9. Click the Parameters & Arguments tab, and then right-click LoanApplication in the Name column.

    This action enables the Edit Value and Clear All Values buttons.

  10. Click Edit Value.
  11. In the Edit Parameter Value window, click Function body, and then replace the contents of the text area with the following text:
    model.mortgage.ilog.com.LoanApplication result = new model.mortgage.ilog.com.LoanApplication();
    model.mortgage.ilog.com.Borrower borrower = new model.mortgage.ilog.com.Borrower();
    result.borrower = borrower;
    borrower.age = 17;
    borrower.citizenship = "Non-Resident Alien";
    borrower.creditGrade = "C";
    borrower.selfEmployed = true;
    return result;
  12. Click OK.
  13. Click Apply, and then click Run.
    Note:

    If a message opens to tell you that changes have been made, click Yes to save the changes.

    The Console view opens and displays information similar to the following to confirm that the scorecard has run successfully.

    Executed scorecard: rulePackage.RiskScorecard
    
    ================= Scorecard settings ==================
    Scoring settings: Sum
    Reasoning settings: Deviation based on expected score
    Maximum number of reasons returned: 4
    Ordered by: Ascending deviation
    Resolve duplication by: Choose maximum deviation
    Filtered by: Negative deviation
    
    ========================== result =====================
    Final score: 155.0
    Returned reasons:
        • Reason code: CREDIT_C, Priority: 3, Description: The credit grade is C., Deviation: -50.0, Conditional Means: 0.0
        • Reason code: NON_RESIDENT, Priority: 2, Description: The borrower is a non-resident alien., Deviation: -25.0, Conditional Means: 0.0
        • Reason code: SELF_EMPLOYED, Priority: 5, Description: The borrower is self employed., Deviation: -20.0, Conditional Means: 0.0
        • Reason code: AGE_TOO_YOUNG, Priority: 1, Description: The borrower is too young., Deviation: -10.0, Conditional Means: 0.0
    
    =======================================================
    Attribute name: LoanApplication.borrower.creditGrade
    Score:40.0
    Maximum score: 0.0
    Expected score:90.0
    Deviation:-50.0
    =======================================================
    Attribute name: LoanApplication.borrower.age
    Score:0.0
    Maximum score: 0.0
    Expected score:10.0
    Deviation:-10.0
    =======================================================
    Attribute name: LoanApplication.borrower.citizenship
    Score:5.0
    Maximum score: 0.0
    Expected score:30.0
    Deviation:-25.0
    =======================================================
    Attribute name: LoanApplication.borrower.selfEmployed
    Score:10.0
    Maximum score: 0.0
    Expected score:30.0
    Deviation:-20.0
    =======================================================
    

Results

The information in the Console view confirms that your scorecard is converted to technical rules and runs in Rule Designer.

In the next task, you publish your scorecard to Decision Center.

< Previous | Next >