Tutorials
Tutorials
Version 7.8
TUTORIALS
For Java
© 2011–2021 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac
Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose,
reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation
purposes to determine whether to purchase a license to the software described in this documentation, or
as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate).
Use of this documentation and the software described in it must conform strictly to the foregoing
permitted uses, and no other use is permitted.
CHAPTER 1:
Introductory Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Module 1 - Developing a Rule Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Opening the Blaze Advisor Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Developing the Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Writing Rules in Rulesets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Creating the AdjustIncomeRuleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Creating the SpecifyFreeGiftRuleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Generating the Decision Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Invoking the Decision Table Wizard and Selecting the Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Defining the Decision Table Ruleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Creating Condition Cell Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Creating the Action Cell Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Editing the Values in the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Generating an Instance File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Inserting a Dynamic Cell Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Adding Rules to the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Assembling the Ruleflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Defining the Ruleflow Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Creating a main() Function to Test the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Building and Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Module 2 - Importing a Java Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Deleting or Renaming the Blaze Advisor Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Importing the External Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Module 3 - Generating an RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Generating the Rule Maintenance Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Editing Values in the RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Viewing the Change in the Blaze Advisor IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Customizing an RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Module 4 - Deploying the Rule Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Deployment Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Deleting the Reference to the Test Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Specifying the Entry Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Generating the Configuration Class Files Needed for Deployment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Editing the Client File to Pass Java Code to the Rule Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Running the Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
CHAPTER 2:
COBOL Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Module 1 - Developing a COBOL Rule Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Opening the Blaze Advisor Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Enabling the Features of Blaze Advisor for COBOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Developing the Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Creating an Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Writing Rules in Rulesets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Creating the AdjustIncomeRuleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Creating the SpecifyFreeGiftRuleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Generating the Decision Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Invoking the Decision Table Wizard and Selecting the Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Defining the Decision Table Ruleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Creating Condition Cell Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Creating the Action Cell Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Editing the Values in the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Generating an Instance File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Inserting a Dynamic Cell Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Adding Rules to the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Creating a Function to Print the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Assembling the Ruleflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Defining the Ruleflow Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Building and Running the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Module 2 - Importing a COBOL Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Deleting the Blaze Advisor Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Importing the COBOL Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Module 3 - Generating an RMA for a COBOL Rule Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Generating the Rule Maintenance Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Editing Values in the RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Viewing the Change in the Blaze Advisor IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Customizing an RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Module 4 - Generating COBOL Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Deleting the Reference to the Test Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Creating an Entry Point for Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Configuring the Deployment Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Using the Wizard to Generate COBOL Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
CHAPTER 3:
Ruleset Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Opening the Project and Including Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Creating the Knockout Ruleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Creating the Variable, Event Rule, and Pattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Writing the Knockout Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Writing the First Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Writing Rules Using the Count Property of an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Writing the Final Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Writing a Function to Test the Ruleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Testing the Knockout Ruleset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Examining the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
CHAPTER 4:
Decision Table Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Working in the Decision Table Tutorial Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Creating the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Setting the Decision Table Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Creating Condition Cell Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Creating the Action Cell Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Editing the Decision Table Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Modifying an Expression Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Writing the Rules Using the Decision Table Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Generating the Instance File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Creating the Structure of the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Importing Decision Table Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Testing the Decision Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Examining the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Examining the Generated Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Reusing the Decision Table Template and Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
CHAPTER 5:
Score Model Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Opening the Score Model Project and Including the XML BOM and Utilities Folders . . . . . . . . . . . . . . . . . . . 103
Editing a Reason Code List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Using the Score Model Wizard to Create the Score Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Creating Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Setting Reason Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Writing Rules in the Score Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Generating the Instance File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Creating Bins for the Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Testing the Score Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Examining the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Viewing the Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Reusing the Score Model Template and Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
CHAPTER 6:
Templates Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Opening the Templates Tutorial Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Converting the Ruleset to a Global Ruleset Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Consolidating Similar Rules in a Rule Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Creating Editable Rule Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Creating an Editable Rule Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Creating Editable Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Creating a List of Enumeration Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Creating an Editable Condition Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Creating an Editable Action Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Creating a Display Format for the Rule Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Enabling Multiple Rule Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Creating a Table for Rule Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Generating the Instance File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Adding New Rules in the Instance Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Testing the Ruleset Template Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Examining the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
CHAPTER 7:
RMA Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Opening the RMA Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Creating a Rule Maintenance Application Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Generating the Rule Maintenance Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Editing Values in the RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Editing the Display Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Using Filters in a Display Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Editing the Score Model Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Editing the Decision Table Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Viewing the Changes in the Blaze Advisor IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Relaunching the RMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
CHAPTER 8:
Ruleflow Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Assembling the Data Validation Ruleflow Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Creating the Data Validation Ruleflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Defining a Ruleflow Variable and the Start Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Adding the Knockout Rules Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Adding a Decision Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Adding Tasks to the Branches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Defining the Entry Point Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Testing the Ruleflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
CHAPTER 9:
Deployment Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Opening the Deployment Tutorial Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Configuring the Deployment Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Releasing the Data Validation Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Generating the Deployment Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Building the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Adding Client Code to Read the Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Building and Running the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
The Results of Building and Running the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
The Blaze Advisor Tutorials provide hands-on experience using the FICO® Blaze Advisor®
decision rules management system. These include:
“Introductory Tutorial” on page 13
This tutorial provides a high-level introduction to creating a deployable rule service.
“COBOL Tutorial” on page 45
This tutorial shows how to create a COBOL subprogram from a rule project.
A set of feature tutorials that focus on specific product features or specific aspects of
the development process.
The feature tutorials include:
“Ruleset Tutorial” on page 76
“Decision Table Tutorial” on page 88
“Score Model Tutorial” on page 101
“Templates Tutorial” on page 117
“RMA Tutorial” on page 134
“Ruleflow Tutorial” on page 141
“Deployment Tutorial” on page 155
These are stand-alone tutorials that can be worked through separately. However, they
are all based on a common business scenario. Completed versions of the tutorial
projects are included in the context of a working implementation of the scenario. You
can explore the complete implementation to see how the various projects and entities
work together to form the business solution.
For a description of the business scenario and solution, see “Overview of the Features
Tutorials Scenario” on page 8.
The folder structure and the various projects in the repository are designed to allow different
users, filling different roles, to perform their work on the various component pieces that
make up the rule services without jeopardizing or interfering with the work of others.
Common components are shared while project-specific items are isolated. Working through
a tutorial should give you some ideas about how to set up your repository and projects to
facilitate concurrent development by multiple users, in addition to providing hands-on
experience with the development tools available in Blaze Advisor.
Rule Services
There are two rule services under the Auto Policy Rules\Rule Services folder:
A Data Validation service that verifies the application data submitted by a potential
customer, and runs some preliminary knockout rules to identify applications that are
obviously unacceptable and avoid further processing.
The “Deployment Tutorial” on page 155 shows you how to create reusable deployment
entities and generate a rule service deployment from this project.
A Policy Underwriting service that:
Obtains a risk score for the applicant
Assigns the applicant to a value tier, representing the applicant’s potential worth to
the company
Determines the policy pricing based on the risk, the potential value, and the
requested coverages
Each of these projects has been used to generate a deployment. The generated deployment
files and the instructions are under
<ADVISOR_HOME>\tutorials\deploymentsAutoPolicy\dataValidation.
Data Validation
The Data Validation service evaluates the initial data provided by the customer who is
applying for the auto insurance policy. A set of knockout rules identifies policy applications
that are obviously unacceptable, and flags them as disqualified. The rules that result in
disqualification also provide message text indicating the reason for the disqualification.
Disqualified applications are sent to a function that archives the application and prepares the
message to send to the applicant. All other applications are sent to a function that prepares
the policy for further processing, and submits it for pricing.
By performing this initial validation of incoming policy applications the applicant can be
informed immediately if there is a problem with the application, and the company is spared
the cost of further processing.
Policy Underwriting
The Policy Underwriting service performs an in-depth evaluation of the policy application
data and determines the premium to offer the applicant. A Score Model evaluates the risk the
company would assume by underwriting the policy and provides an overall risk score, along
with ranked reasons for how the score was obtained. Policies that carry an unacceptable risk
are disqualified without further processing. Other policies are evaluated to determine the
overall value of the applicant to the company, and then passed to a ruleset that determines
the premium, based on the requested coverage, the risk, and the customer value.
Repository Structure
The rule services consist of a variety of component entities and are the result of the activity
of a range of users, including the business users who are responsible for the rules, the
service architects who are responsible for defining the service interfaces and flow control,
and the Information Technology (IT) developers who are responsible for deploying the
services into the company’s IT infrastructure. The repository is structured to provide users in
different roles with appropriate access to the entities they are interested in while shielding
them from other entities.
The service component entities are stored in two libraries:
The Business Library stores the rules that are authored by the business users.
The Technical Library stores the ruleflows, templates, functions, and business object
models that are produced by the rule service architects and control how the services are
structured and invoked.
The individual service components and the defined services need to be developed and tested
before the services can be released and deployed into the production environment. The
Testing folder contains all the various test bed functions for unit testing the component
entities as well as the ruleflows that define the execution of the services.
Released versions of the services are stored in the Rule Services folder. IT developers
access these service projects for use in their deployments.
When the projects are ready to be deployed, IT developers can use the deployment entities in
the Deployment Library to set the configurations necessary to deploy the projects.
This structure facilitates a clear separation of responsibilities for the various roles. While this
tutorial repository does not implement an authorization scheme, it would be relatively simple
to provide appropriate levels of access control at the folder level for different user roles.
See Also: For more information about authorization, see the Authentication and
Authorization Manager Example in the Examples section of the Blaze Advisor
documentation.
Note: For more information about using XML classes in Blaze Advisor, see “Integrating XML
Structures with Blaze Advisor” in Developing Rule Projects.pdf.
Projects
Blaze Advisor projects contain references to the folders in the repository. You create a
project for some specific purpose, and then include references to any folders or subfolders
that contain entities you want to use. You can also create new folders, and create new
entities, which you can store in any of the referenced folders.
Note: For simplicity, this tutorial repository does not provide any access controls. If it did, the
folders you could reference from a project and the access you would have to the entities in
the folders would depend on your assigned privileges.
Multiple projects can reference the same folder. In the Auto Policy scenario, this is used to
separate the development and testing of individual rulesets from the development of the
ruleflows that define the services. For example, the Business Library contains a folder called
Knockout Rules, which contains a single ruleset called KnockoutRuleset. The business
experts who are responsible for the knockout rules access the ruleset through a project
called Knockout Rules Development, which is in the Testing > Unit Testing folder. The service
architects who are responsible for incorporating the knockout rules into the data validation
service access the ruleset from a project called Data Validation Ruleflow Testing, which is in
the Testing > Rule Service Testing folder. Each project references the Knockout Rules folder.
Note: If access privileges were being assigned, the business experts would have read/write
access to the Knockout Rules, while the service architects would have read-only access.
Each project has its own testing requirements, and each references its own folder for storing
test functions. The development and unit testing of the ruleset is completely independent of
the development and testing of the ruleflow. As long as the data context for the ruleset, such
as the parameters and return type, are agreed upon and in place, the business experts and
the ruleflow architects can go about their business simultaneously.
Many of the feature tutorials recreate a project in Auto Policy Rules. The Ruleset Tutorial
recreates the Knockout Rules Development project described above, while the Ruleflow
Tutorial recreates the Data Validation Ruleflow Testing project. In addition to creating new
entities, the tutorials show you how to reference existing folders and use the contents in a
new project. Each tutorial includes a discussion about how the project relates to the overall
business scenario and provides instructions for completing the project.
The introductory tutorial for the FICO® Blaze Advisor® decision rules management system
guides you through the process of developing a rule service, importing an external object
model, generating a rule maintenance application, and creating a rule server deployment.
The tutorial is divided into four modules. You can complete all of the modules or just the
ones that interest you. If you complete the first module, you can use that project for the other
three modules. If you would prefer to skip the first module, you can use the project under the
Completed Tutorial folder in the repository to do the other modules.
It takes about two hours to complete all of the modules; however, you can complete one
module and continue where you left off at any time.
Tip: If you need more information about the layout of the Blaze Advisor IDE, see “Tour of the
Blaze Advisor IDE” in DevelopingRuleProjects.pdf.
Creating a Project
The first step is to create a project. A project is a managed repository entity that contains one
or more references to folders and other projects. All of the project items that you create in
this tutorial, such as the rulesets, the decision table, and the object model will be stored in a
folder referenced by the project.
To create a project
1 Create a new project using one of these options:
Select File > New > Project.
Click the New icon on the File toolbar and select Project.
The New Project Wizard opens:
2 Expand the Blaze Advisor folder, select Rule Project, and click Next.
3 Select Introductory Tutorial Repository and click Next.
4 In the Project Name field, enter Credit Card and in the Select folder panel, select _My
Work. Keep the Create project directory check box selected and click Finish.
To open the Project editor, right-click the project name, Credit Card [Introductory Tutorial
Repository], and select Open Project Editor. The Project editor is displayed in the Editor
pane on the right, as shown in this figure:
The project references the Credit Card folder, which is why you see it in the Editor pane.
All of the project items that you create will be stored in this folder.
Caution: Be sure to enter the class properties correctly, as it is easy to forget to define
the type of a class property.
8 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
Note: Blaze Advisor is case-sensitive, so when you write the rules in SRL make sure that the
capitalization matches the text shown.
2 In the Entity name field, enter AdjustIncomeRuleset and click Finish to open the
Ruleset editor.
3 Retain void in the Return Type field, and retain <Default> in the Execution Mode field.
4 Click the New Parameter icon .
5 Name the parameter:
newApplicant
6 From the Type drop-down list, select CardApplicant.
7 Click the New Rule icon on the Ruleset editor toolbar or in the Content section.
8 Replace rule1 and enter this text for the rule name:
Six_mos_or_less_on_the_job
You cannot use spaces in the names of rules or other SRL entities, such as rulesets,
classes, variables, and objects to name a few examples. Spaces are allowed in non-SRL
entities, such as ruleflows and templates.
9 Expand the rule name field in order to display the SRL rule body area. Enter this SRL in
the rule body:
if newApplicant's mosInCurrentJob is less than or equal to 6
then decrement newApplicant's income by 5600.
This is how the new rule appears:
10 Repeat the previous three steps to add these rules to the ruleset, using the names and
content listed as follows:
Name:
About_1year
Content:
if newApplicant's mosInCurrentJob is greater than 6
and newApplicant's mosInCurrentJob is less than or equal to 12
then increment newApplicant's income by 1000.
Name:
Greater_than_1year
Content:
Note: The line that begins with then newApplicant's totalIncome wraps to the next
line due to space limitations in this document. This next line begins with
newApplicant’s. Enter these two lines on the same line in the rule body.
11 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
A decision table is a tabular representation of a ruleset. At runtime, the rules in the decision
table resolve to a ruleset, which you know from the previous section is a group of rules. Each
rule in a decision table is a complete rule, and all of the rules in the decision table form the
ruleset.
When you created the two rulesets in the previous section, you wrote each rule using SRL.
When you create a decision table, you can use the Decision Table Wizard which
automatically generates the rule SRL for you. All you do is edit the values.
This is the SRL for the first two rules in the table:
The only difference between these two rules is the value of the creditHistory property. If
you are writing a large number of rules with a similar construction, a decision table is usually
the most expedient way to write rules.
Note: The name you are entering is for display purposes only in the decision table. The
display name will be used for the header in the decision table column. The underlying
rules will use the class property name and not the display name.
4 Leave the check box in the Optional column cleared.
5 Select newApplicant, and click the arrow to add it to the Condition Columns panel.
6 In the Condition Columns panel, double-click in the Display Name field, change the name
to Dynamic Condition, and press Enter. The display name is only used in the Property
Picker dialog in the decision table that allows the selection of a specific class property.
The Optional check box is selected and disabled because this will be a dynamic
condition cell group.
7 Retain 2 in the Depth field because the CardApplicant class does not have any
subclasses or class-type properties. If it did, you would select the depth of the properties
that you wanted to be able to access in the decision table.
8 Click Next.
3 In the Action Cell Groups panel, double-click in the Display Name field, change the name
to Card Type, and press Enter.
4 Click Finish.
3 Double-click in the first cell in the Total Income column, replace 0 and 0 with these
values:
40000
60000
4 Double-click in the second cell in the Total Income column, replace 0 and 0 with these
values:
60000
80000
5 Single-click in the third cell in the Total Income column, right-click and select Format Cell
> >='real'
6 Click in the cell and replace 0 with this value:
80000
7 For the fourth cell in the Total Income column, replace 0 and 0 with these values:
40000
60000
8 For the fifth cell in the Total Income column, replace 0 and 0 with these values:
60000
80000
9 For the last cell in the Total Income column, single-click in the cell, right-click and select
Format Cell > >='real'
10 Click in the cell and replace 0 with this value:
80000
11 Because the Rolling Over Balances cell group is based on a boolean property, the default
value in each cell is true. For the bottom three cells, click in the cell and type F to change
the value to false.
Note: You can also copy and paste values using the following methods:
Keyboard shortcuts: Ctrl+C and Ctrl+V.
Menu commands: Edit > Copy and Edit > Paste.
Single-click the cell you want to copy, right-click the selected cell, and select Copy.
Then single-click the cell where you want to paste it, right-click the selected cell, and
select Paste.
4 Fill in the rest of the action values, so that the table looks like this:
According to the ruleflow diagram, when the project is run the following tasks are
implemented:
AdjustIncome, which adjusts the income of the applicant based on how long they have
worked for their current employer. Also, if the applicant has a spouse, the income of the
spouse is added to the income of the applicant.
DetermineCardType, which determines a card type for the applicant. If the total income
of the applicant is below $40,000, the applicant is not eligible for a card.
SpecifyGift, which determines the promotional gift for those applicants eligible to receive
a credit card.
Tip: When you select the Whenever a/an statement, a blue outline of the statement
should display, as shown in the following figure:
8 Click the arrow twice to expand the field. Enter it in the Assign field, and in the To field,
select newApplicant.
You perform this step so that whenever an instance of the CardApplicant class is
posted to the ruleflow, it is assigned to the newApplicant ruleflow variable. The variable
is local to the ruleflow, and is only available during ruleflow processing.
This is how the fields in the Settings tab appear:
2 Click the Insert Task icon in the ruleflow toolbar. The cursor changes to a set of
crosshairs.
3 Place the crosshairs on the line between the two nodes in the ruleflow.
You know that you are placing the task in a valid location when a shadow box appears
between the nodes.
4 Click once to insert the task. A box labeled Task1 appears.
5 Click the Insert Task icon and click to the right of Task 1.
6 Click the Insert Task icon and click to the right of Task 2.
The ruleflow should now look like this:
d Close the Task editor and when prompted, save your changes.
2 Double-click on Task 2 to open the Task editor.
a In the Task field, enter:
DetermineCardType
b From the Implementation drop-down list, select Determine Card Decision Table
Instance.
c In the Implementation Arguments field, enter:
newApplicant
The decision table return type is void, so leave the Assign value returned from
Implementation to field set to <none>.
d Close the Task editor and when prompted, save your changes.
3 Double-click on Task3 to open the Task editor.
a In the Task field, enter:
SpecifyGift
b From the Implementation drop-down list, select
SpecifyFreeGiftRuleset(CardApplicant).
c In the Implementation Arguments field, enter:
newApplicant
The ruleset return type is void, so leave the Assign value returned from
Implementation to field set to <none>.
d Close the Task editor and when prompted, save your changes.
The ruleflow should look like this:
7 In the Include Folder or Project dialog box, expand _My Work, select Test, and click
Include.
8 In the Project Explorer, select the Test folder, and create a new function in the folder
using one of these options:
Select File > New > SRL Decision Entities > Function.
Click the New Function icon on the Blaze Advisor Entities toolbar.
9 In the Entity name field, enter main and click Finish.
10 Retain void in the Return type field, and retain <Default> in the Execution Mode field.
11 Enter this text into the Function body, or copy and paste it from this document or the
completed tutorial project:
newApp is a CardApplicant initially{
annualAirlineTrips = 6.
creditHistory = "Good".
income = 38000.
isMarried = true.
mosInCurrentJob = 12.
recommendedCard = null.
rollingOverBalances = true.
spousalIncome = 41000.
}
events().postEvent(newApp).
executeAgent().
if newApp.recommendedCard is not null
then print("You are eligible for a " newApp's recommendedCard " card and you will
receive a " newApp's gift".").
else print("You are not eligible for a card at this time. Please contact one of
our representatives.").
Tip: In the two print statements above, the text is wrapped due to space limitations in
this document. When typing the SRL into the Function body field, expand the Editor so
you can type the SRL on one line.
12 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Credit Card Run Configuration is automatically run with the Run As
command because there is a matching configuration for the currently selected project. If
you receive a message stating there are no recent launches, then select Run > Run
History > (number) Credit Card Run Configuration, where (number) represents the
numeral associated with one of the previous configuration runs.
You see this message in the Console view:
You are eligible for a Platinum card and you will receive a Leather
Briefcase.
To change the outcome of the project, you can change the initial values in the main()
function. For example, if you change the initial value of the creditHistory property to
“Excellent” , save the change, and run the project again, you see this message:
You are eligible for a Diamond card and you will receive a Gift
Certificate.
If you set the spousalIncome property to 0, save the change, and run the project again,
you see the rejection message:
You are not eligible for a card at this time. Please contact one of
our representatives.
If you want to use this project for the other modules, and you have changed the initialized
values of the object properties in the main() function, reset the values to the ones
shown below and save the changes:
annualAirlineTrips = 6.
creditHistory = “Good”.
income = 38000.
isMarried = true.
mosInCurrentJob = 12.
recommendedCard = null.
rollingOverBalances = true.
spousalIncome = 41000.
If you do not want to reset the values, you can use the project under the Completed
Tutorial folder for the other modules.
6 In the Java Business Object Model field, erase the default entry, and enter:
Card Applicant Java BOM
7 In the Comments field, enter:
The CardApplicant class was imported on <today’s date>.
8 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
The Java Business Object Model (BOM) appears in the Object Model Explorer, as shown
below:
Tip: If the BOM does not display in the Object Model Explorer, build the project by
selecting Project > Build Project. The BOM should now appear.
9 Expand the CardApplicant class to see its properties.
10 Build and run the project using the steps in the next procedure.
Tip: The Credit Card Run Configuration is automatically run with the Run As command
because there is a matching configuration for the currently selected project. If you
receive a message stating there are no recent launches, then select Run > Run History >
(number) Credit Card Run Configuration, where (number) represents the numeral
associated with one of the previous configuration runs.
You see this message in the Console view
You are eligible for a Platinum card and you will receive a Leather
Briefcase.
Note: The first time an RMA is launched, if Blaze Advisor does not detect a browser, you will
be prompted to specify the path to the .exe file for your browser.
same, it is just that the version in the RMA has a different look and feel in keeping with the
fact that is embedded in a web-based application.
To view the change made in the RMA within the Blaze Advisor IDE
1 In the Project Explorer, right-click the Credit Card [Introductory Tutorial
Repository] project and select Refresh.
2 In the Credit Card Folder, double-click the Determine Card Decision Table Instance
to open it in the Editor pane.
3 Notice that PlatinumPlus appears in the third row starting with >= 80,000.
4 Select Project > Build Project.
A message appears in the Problems view confirming a successful build.
5 Click the Run icon on the Launch toolbar or select Run > Run, or right-click the project
in the Project Explorer and select Run As > 1 Blaze Advisor Project.
Tip: The Credit Card Run Configuration is automatically run with the Run As command
because there is a matching configuration for the currently selected project. If you
receive a message stating there are no recent launches, then select Run > Run History >
(number) Credit Card Run Configuration, where (number) represents the number
associated with one of the previous configuration runs.
This is the new result. Notice that it is different because the rule value was changed.
You are eligible for a PlatinumPlus card and you will receive a Gift
Certificate.
This time the applicant receives a PlatinumPlus card instead of a Platinum card, and a
Gift Certificate instead of a Leather Briefcase.
If for some reason, the outcome does not match what you see in the Console view,
double-check to see that the initial values in the main() function in the Test folder are
set correctly:
annualAirlineTrips = 6.
creditHistory = "Good".
income = 38000.
isMarried = true.
mosInCurrentJob = 12.
recommendedCard = null.
rollingOverBalances = true.
spousalIncome = 41000.
Customizing an RMA
In this tutorial, you used the default settings for the rule maintenance application. When you
create your rule maintenance application, you will probably want to customize the look and
feel of the application to create an editing environment that makes your analysts most
comfortable.
For example, you can add text or graphics that help guide your analysts as they update the
rules. Additionally, you can change the colors, font types, and font sizes used in the pages.
See Also: For more information, see “Generating Rule Maintenance Applications” in
DevelopingRuleMaintenanceApplications.pdf.
Deployment Overview
When a project, such as the Credit Card project, is controlled by a ruleflow, you can use a
ruleflow invoker deployment. Business data is mapped in as arguments to the invocation
method. The Start Event handler on the ruleflow begins execution when the event is received.
In this case, the event is the presence of an instance of the CardApplicant class.
In the Blaze Advisor IDE, you tested the project using an object instance of the
CardApplicant class called newApp in the main() function. However, this object is just for
testing the rules in the Blaze Advisor IDE. When you deploy the project, you need to pass the
data to the rule service as a series of arguments.
In this module, you will complete the following actions:
Delete the reference to the Test folder.
Specify an entry point for the rule service.
Use the Generate Deployment Wizard to generate the configuration and class files.
Edit the client file to pass the data to the rule service.
Build and run the deployment.
Note: The Entry Point ID field is automatically filled in after selecting the functional item.
7 In the Entry Point ID field, add post to the beginning of the functional name so that the
name appears as: postCredit_Card_Ruleflow
8 Click Finish to close the Entry Point Wizard.
9 Save your changes.
Tip: In this procedure, the Deployment and System Definitions are created using the
Generate Deployment Wizard. You have the option of creating a Deployment Definition,
System Definition, or both, and then referencing them from the wizard. There is a
Deployment Tutorial, which is part of the Features Tutorials, that explains how to do this. See
“Deployment Tutorial” on page 155.
Summary
After you have completed all of the Introductory Tutorial modules, or just the ones you
wanted to complete, you can learn more about Blaze Advisor using the Feature Tutorials.
COBOL Tutorial
This tutorial guides you through the process of developing a rule service, importing COBOL
data definitions, generating a rule maintenance application, and deploying the rules as
COBOL code using the FICO® Blaze Advisor® decision rules management system.
The tutorial is divided into four modules. You can complete all of the modules or just the
ones that interest you. If you complete the first module, you can use that project for the other
three modules. If you would prefer to skip the first module, you can use the project under the
Completed Tutorial folder in the repository to do the other modules.
It takes about two hours to complete all of the modules; however, you can complete one
module and continue where you left off at any time.
Note: While this tutorial is similar to the Introductory Tutorial, it demonstrates some features
that are unique to developing and deploying a rule project using a COBOL object model.
Tip: If you need more information about the layout of the Blaze Advisor IDE, see “Tour of the
Blaze Advisor IDE” in DevelopingRuleProjects.pdf.
Creating a Project
This first step is to create a project. A project is a managed repository entity that contains
one or more references to folders and other projects, resulting in a collection of folders. All of
the project items that you create in this tutorial, such as the rulesets, the decision table, and
the object model will be stored in folders that will be referenced by the project.
To create a project
1 Create a new project using one of these options:
Select File > New > Project.
Click the New icon on the File toolbar and select Project.
The New Project Wizard opens:
2 Expand the Blaze Advisor folder, select Rule Project, and click Next.
3 Select COBOL Tutorial Repository and click Next.
4 In the Project Name field, enter Credit Card and in the Select folder panel, select _My
Work. Keep the Create project directory check box selected and click Finish.
To open the Project editor, right-click the project name, Credit Card [COBOL Tutorial
Repository], and select Open Project Editor. The Project editor is displayed in the Editor
pane on the right, as shown in this figure:
The project references the Credit Card folder, which is why you see it in the Editor pane.
Most of the project items that you create will be stored in this folder.
test your object model and rules before the external object model is fully defined. In this
section, you create a Blaze Advisor class called CardApplicant and define its properties.
Caution: Be sure to enter the class properties correctly, as it is easy to forget to define
the type of a class property.
8 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
Creating an Object
In this section, you create an object of type CardApplicant which will pass data into the
rule project. In a real-world application, data is passed in from an external source such as
another COBOL application or a comma separated file.
understand what SRL can and cannot be used with a COBOL object model, see
“Blaze Advisor Built-in Functions Library” in Reference.pdf.
Blaze Advisor offers a way to check the SRL in your project. After you set the Target
Language to COBOL, which you did in “Enabling the Features of Blaze Advisor for COBOL”
on page 47, the Check SRL for COBOL icon appears on the Ruleset, Function, and
Ruleflow editor toolbars. The Check SRL for COBOL icon allows you to verify that the SRL in
an editor and its tree of calls is acceptable for COBOL code generation. You will use this icon
after you create the AdjustIncomeRuleset.
Note: Blaze Advisor is case-sensitive, so when you write the rules in SRL make sure that the
capitalization matches the text shown.
3 Retain void in the Return Type field, and retain <Default> in the Execution Mode field.
4 Click the New Parameter icon .
5 Name the parameter:
newApp
6 From the Type drop-down list, select CardApplicant.
7 Click the New Rule icon on the Ruleset editor toolbar or in the Content section.
8 Replace rule1 and enter this text for the rule name:
Six_mos_or_less_on_the_job
You cannot use spaces in the names of rules and other SRL entities, such as rulesets,
classes, variables, and objects to name a few examples. Spaces are allowed in non-SRL
entities such as ruleflows and templates.
9 Expand the rule name field in order to display the SRL rule body area. Enter this SRL in
the rule body:
if newApp's mosInCurrentJob is less than or equal to 6
then decrement newApp's income by 5600.
This is how the new rule appears:
10 Repeat the previous three steps to add these rules to the ruleset, using the names and
content listed as follows:
Name:
About_1year
Content:
if newApp's mosInCurrentJob is between 7 and 12
then increment newApp's income by 1000.
Name:
Greater_than_1year
Content:
if newApp's mosInCurrentJob is greater than 12
then increment newApp's income by 2500.
Name:
ComputeTotal_income
Content:
if newApp's isMarried is "true"
and newApp's spousalIncome is greater than 0
then newApp's totalIncome is equal to newApp's income plus newApp's spousalIncome.
else newApp's totalIncome is equal to newApp's income.
Note: The line that begins with then newApp’s totalIncome wraps to the next line
due to space limitations in this document. This next line begins with spousalIncome.
Enter these two lines on the same line in the rule body.
Name:
Minimum_income
Content:
if newApp's totalIncome is less than 40000
then {
print("You are not eligible to receive a card at this time. Please contact our
office.").
exit().
}
Note: The line that begins with print(“You are wraps to the next line due to space
limitations in this document. This next line begins with contact our office. Enter
these two lines on the same line in the rule body.
11 Save your changes using one of these options:
2 In the Problems view, notice that the SRL in the About_1year rule in the ruleset contains
a comparison operator, is between, which is not supported for COBOL code generation.
This error displays:
Error: Range comparison operator "between" is not supported for
COBOL.
3 Double-click the error. The Rule editor for the About_1year rule opens.
4 Replace the SRL in the rule with this SRL:
if newApp's mosInCurrentJob is greater than 6
and newApp's mosInCurrentJob is less than or equal to 12
then increment newApp's income by 1000.
5 Save your changes using one of these options:
Select File > Save All.
Use the keyboard shortcut: Ctrl + S.
Click the Save icon on the File toolbar.
6 Close the AdjustIncomeRuleset editor and then reopen it.
7 In the AdjustIncomeRuleset editor toolbar, click the Check SRL for COBOL icon.
All of the SRL in the ruleset is now supported for COBOL code generation.
Note: The remainder of the SRL that you write in this tutorial is supported for COBOL code
generation. While it is not necessary to double-check the SRL in each editor as you complete
this tutorial, you can click the Check SRL for COBOL icon on any Ruleset, Function, or
Ruleflow editor at any time.
A decision table is a tabular representation of a ruleset. At runtime, the rules in the decision
table resolve to a ruleset, which you know from the previous section is a group of rules. Each
rule in a decision table is a complete rule, and all of the rules in the decision table form the
ruleset.
When you created the two rulesets in the previous section, you wrote each rule using SRL.
When you create a decision table, you can use the Decision Table Wizard that automatically
generates the rule SRL for you. All you do is enter the values.
This is the SRL for the first two rules in the table:
The only difference between these two rules is the value of the creditHistory property. If
you are writing a large number of rules with a similar construction, a decision table is usually
the most expedient way to write rules.
Note: The name you are entering is for display purposes only in the decision table. The
display name will be used for the header in the decision table column. The underlying
rules will use the class property name and not the display name.
4 Leave the check box in the Optional column cleared.
5 Select newApplicant, and click the arrow to add it to the Condition Columns panel.
6 In the Condition Columns panel, double-click in the Display Name field, change the name
to Dynamic Condition, and press Enter. The display name is only used in the Property
Picker dialog in the decision table that allows the selection of a specific class property.
The Optional check box is selected and disabled because this will be a dynamic
condition cell group.
7 Retain 2 in the Depth field because the CardApplicant class does not have any
subclasses or class-type properties. If it did, you would select the depth of the properties
that you wanted to be able to access in the decision table.
8 Click Next.
2 Click in the margin above the blank cell above Card Type, and then add two columns
using one of these options:
Click the Add Column icon on the toolbar.
Right-click, and select Insert New Column to the Left or Insert New Column to the
Right.
The Add Column icon always adds a column to the right, and the insert command always
inserts a column to the left or to the right of where the cursor is placed. It does not
matter which command you use.
Note: You can also copy and paste values using the following methods:
Keyboard shortcuts: Ctrl+C and Ctrl+V.
Menu commands: Edit > Copy and Edit > Paste.
Single-click the cell you want to copy, right-click the selected cell, and select Copy.
Then single-click the cell where you want to paste it, right-click the selected cell, and
select Paste.
4 Fill in the rest of the action values, so that the table looks like this:
7 In the Include Folder or Project dialog box, expand _My Work, select Test, and click
Include.
According to the ruleflow diagram, when the project is run the following tasks are
implemented:
AdjustIncomeRuleset, which adjusts the applicant’s income based on the length of time
in their current job and adds any applicable spousal income to the applicant’s income. It
also eliminates any applicants whose total income is less than $40,000.
DetermineCardType, which determines a card type for the applicant.
SpecifyGift, which determines the promotional gift for those applicants eligible to receive
a credit card.
PrintTestResults, which prints the results of rule processing.
Click the New Ruleflow icon on the Blaze Advisor Entities toolbar.
2 In the Entity name field, enter Credit Card Ruleflow and click Finish.
You can use spaces in a ruleflow name.
3 Click the Settings tab at the bottom of the editor.
4 Under Ruleflow starts, select the Automatically check box.
This sets the ruleflow to start when the project is run.
2 Click the Insert Task icon . The cursor changes to a set of crosshairs.
3 Place the crosshairs on the line between the two nodes in the ruleflow. You know that
you are placing the task in a valid location when a shadow box appears between the
nodes.
4 Click once to position the task. A box labeled Task1 appears.
5 Click the Insert Task icon and place it after Task 1.
6 Click the Insert Task icon and place it after Task 2.
7 Click the Insert Task icon and place it after Task 3.
The ruleflow should now look like this:
d Close the Task editor and when prompted, save your changes.
2 Double-click on Task 2 to open the Task editor.
a In the Task field, enter:
DetermineCardType
b From the Implementation drop-down list, select Determine Card Decision Table
Instance.
c In the Implementation Arguments field, enter:
newApplicant
The decision table return type is void, so leave the Assign value returned from
Implementation to field set to <none>.
d Close the Task editor and when prompted, save the changes.
3 Double-click on Task 3 to open the Task editor.
a In the Task field, enter:
SpecifyGift
b From the Implementation drop-down list, select
SpecifyFreeGiftRuleset(CardApplicant).
c In the Implementation Arguments field, enter:
newApplicant
The ruleset return type is void, so leave the Assign value returned from
Implementation to field set to <none>.
d Close the Task editor and when prompted, save your changes.
4 Double-click on Task 4 to open the Task editor.
a In the Task field, enter:
PrintTestResults
b From the Implementation drop-down list, select printResults(CardApplicant).
c In the Implementation Arguments field, enter:
newApplicant
The ruleset return type is void, so leave the Assign value returned from
Implementation to field set to <none>.
d Close the Task editor and when prompted, save your changes.
This is how the ruleflow appears:
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Credit Card Run Configuration is automatically run with the Run As
command because there is a matching configuration for the currently selected project. If
you receive a message stating there are no recent launches, then select Run > Run
History > (number) Credit Card Run Configuration, where (number) represents the
number associated with one of the previous configuration runs.
If you do not want to reset the values, you can use the project under the Completed
Tutorial folder for the other modules.
Blaze Advisor internally stores the content of the original copybook. Blaze Advisor also
retains the original COBOL fields, and any initialized values that were set in the
copybook. The original copybook definitions are used during the conversion from SRL to
COBOL output. This process is called COBOL code generation. For more information, see
“Importing COBOL Structures in Blaze Advisor” in COBOLReference.pdf.
2 In the first page of the wizard, click Select File to open the Select File dialog box.
3 Locate this path:
<ADVISOR_HOME>\tutorials\businessObjectModels\cobol
4 Select CardApplicant.cpy, and click Open.
You see the name of the copybook to be imported.
5 Click Next twice.
6 Expand the Classes, CardApplicant, and Properties categories.
You see all of the properties in the imported class. You do not have to import all of the
properties in a class. However, for this tutorial, retain the check marks next to the
properties because they are all required to run the project successfully.
Optionally, you can change the name of a property for display purposes in the
Blaze Advisor IDE, but do not do that for this tutorial or the project will not build.
7 Click Finish.
You see the editor for the COBOL Business Object Model.
8 In the COBOL Business Object Model field, erase the default entry, and enter:
Card Applicant COBOL BOM
9 In the Comments field, enter:
The CardApplicant class was imported on <today’s date>.
10 Save your changes.
The COBOL Business Object Model (BOM) appears in the Object Model Explorer, as
shown below:
Tip: If the BOM does not display in the Object Model Explorer, build the project by
selecting Project > Build Project. The BOM should now appear.
11 Expand CardApplicant to see the class properties.
Tip: The Credit Card Run Configuration is automatically run with the Run As command
because there is a matching configuration for the currently selected project. If you
receive a message stating there are no recent launches, then select Run > Run History >
(number) Credit Card Run Configuration, where (number) represents the number
associated with one of the previous configuration runs.
You see this message in the Console view
You are eligible for a Platinum card and you will receive a Leather
Briefcase.
To view the change made in the RMA within the Blaze Advisor IDE
1 In the Project Explorer, right-click the Credit Card [COBOL Tutorial Repository]
project and select Refresh.
2 In the Credit Card Folder, double-click the Determine Card Decision Table Instance
to open it in the Editor pane.
3 Notice that PlatinumPlus appears in the third row starting with >= 80,000.
4 Select Project > Build Project.
A message appears in the Problems view confirming a successful build.
5 Click the Run icon on the Launch toolbar, or select Run > Run, or right-click the
project in the Project Explorer and select Run As > 1 Blaze Advisor Project.
Tip: The Credit Card Run Configuration is automatically run with the Run As command
because there is a matching configuration for the currently selected project. If you
receive a message stating there are no recent launches, then select Run > Run History >
(number) Credit Card Run Configuration, where (number) represents the number
associated with one of the previous configuration runs.
This is the new result. Notice that it is different because the rule value was changed.
You are eligible for a PlatinumPlus card and you will receive a Gift
Certificate.
This time, the applicant receives a PlatinumPlus card instead of a Platinum card, and a
Gift Certificate instead of a Leather Briefcase.
If for some reason, the outcome does not match what you see in the Console view,
double-check to see that the initial values in the newApplicant object in the Credit Card
Folder are set correctly:
annualAirlineTrips = 6.
creditHistory = "Good".
income = 38000.
isMarried = "true".
mosInCurrentJob = 12.
rollingOverBalances = "true".
spousalIncome = 41000.
Customizing an RMA
In this tutorial, you used the default settings for the rule maintenance application. When you
create your rule maintenance application, you will probably want to customize the look and
feel of the application to create an editing environment that makes your analysts most
comfortable.
For example, you can add text or graphics that help guide your analysts as they update the
rules. Additionally, you can change the colors, font types, and font sizes used in the pages.
See Also: For more information, see ““Generating Rule Maintenance Applications” in
DevelopingRuleMaintenanceApplications.pdf”.
See Also: For more information about which Blaze Advisor built-ins are supported for
projects with a COBOL object model, see “Supported and Unsupported Blaze Advisor Built-in
Functions” in Reference.pdf.
Note: When the COBOL compatible option is selected and the Code Generation project
property is set to COBOL, Optimized mode for all metaphors is ignored.
6 Next to the Entry Points field, click Add.
7 From the Functional Item drop-down list, select mainForCOBOL().
Note: The Entry Point ID field is automatically filled in after selecting the functional item.
8 Click Finish to close the Entry Point Wizard.
9 Save your changes.
Click Browse to open the Select Folder dialog box and locate the desired directory.
4 Click Finish.
The generated COBOL files are in the folder you specified in the Target Directory field in the
Generate Deployment Wizard. The CBLPGM.cbl file contains the rules. For a description of
each generated file, see “Files That Comprise the Generated COBOL Subprogram” in
COBOLReference.pdf.
Note: In this tutorial, the input data is contained in the Initially section of the newApplicant
object and the entry point, mainForCOBOL(), does not contain any parameters or return type.
In real-world COBOL applications, input data is usually passed into the entry point through
parameters from some external data source.
This FICO® Blaze Advisor® decision rules management system feature tutorial shows you
how to create a set of rules, also known as a ruleset. You will also learn how to write a
function that allows you to test the ruleset using the provided test data.
A ruleset is a grouping of rules. It is recommended to group your rules into a ruleset because
it:
Permits the Blaze Advisor project to model a work-flow process
Improves the readability and maintainability of the rulebase
Can significantly improve the performance of the rule engine by limiting the scope of the
rule engine to the current group of rules
This is a figure of the ruleset you will create in this tutorial:
Using the figure above, you can see that the ruleset contains several rules. You can also see
other Structured Rule Language (SRL) entities that are used to write the rules. You will create
these entities as part of this tutorial.
In this tutorial, the rules will eliminate insurance applicants who do not qualify for an
insurance policy. The rules evaluate each application and determine whether or not the
applicant meets the minimum requirements for processing. For example, the applicant must
be 16 and a resident of the United States.
Prerequisites for this tutorial: You should have a basic understanding of how to use. If you
are new to the Blaze Advisor IDE, complete the “Introductory Tutorial” on page 13 or review
the Blaze Advisor documentation.
Time estimate: 60 minutes
Role of the ruleset in the completed tutorial: In a real-world situation, a ruleset is just one
component of a rule service. While you are completing this tutorial, assume that you are part
of a project team assigned to create the ruleset that will evaluate applicant data and
disqualify applicants who do not meet the requirements of the insurer.
The ruleset will be created in a separate folder and tested. After the ruleset is completed, it
becomes integrated into the project. In this tutorial, you will just create the ruleset and then
view how the ruleset is used in the completed project.
To view the completed version: In the IDE, you can view a completed version of the ruleset at
any time. The completed version is located in the Knockout Rules Development project under
this directory: Auto Policy Rules\Testing\Unit Testing\Knockout Rules
Development Folder. See “Opening the Project and Including Folders” on page 77.
In the Repository Explorer, expand the Knockout Rules Development Folder and you will see
the main function and the Knockout Rules Development project. Expand the Knockout Rules
Development project and you will see four referenced folders:
Auto Policy XML BOM
Knockout Rules
Knockout Rules Development Folder
Utilities
To open the project and include the AutoPolicy BOM and Utilities
folders
1 Select File > Import, expand the Blaze Advisor folder, select Rule Project, and click Next.
2 In the Select Repository wizard page, select Feature Tutorials Repository and click Next.
3 In the Select a Blaze Advisor Project wizard page, expand the Ruleset Tutorial folder,
select the Ruleset Tutorial Project, and click Finish to open the project.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project... command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
9 Select File > Refresh to update the contents of the repository.
The AutoPolicy XML BOM and Utilities folders are now included in the Ruleset Tutorial
Project.
Note: Blaze Advisor is case-sensitive, so when you create entities, as well as when you write
the knockout rules, ensure that the capitalization matches the text shown.
Tip: You can copy the SRL from this document and paste it into the Initially field or open the
completed tutorial in another instance of Blaze Advisor. Be sure to use straight quotes for
any quotation marks in the Blaze Advisor IDE. You can follow this copy/paste procedure each
time the tutorial asks you to enter SRL into an entity.
Tip: To view the properties of the PersInfo class, expand the Auto Policy XML BOM
folder, Auto Policy BOM, and the PersInfo class, in the Object Model Explorer. If the
folder does not display in the Object Model Explorer, build the project by selecting
Project > Build Project. The folder should now appear.
Each rule that begins with check determines if the applicant passes certain eligibility
requirements such as being at least 16 years of age. If the applicant does not pass the
criteria, then the rule assigns the status of disqualified and associates a reason with the
disqualification.
The reason is represented by the property, ReasonText, and is located in the body of the
rule. It describes why the applicant has been disqualified and can be written in many ways.
For example, in the following checkAge rule, the reason text describes that the applicant is
under the age of 16.
Also note that at the end of each check rule, you are assigning the values (status and
ReasonText) from the decision variable to the ruleset’s parameter, thePolicy, and then
returning it to the Data Validation Ruleflow.
Tip: The Comments icon is located in the upper right-hand corner in the rule editor:
return.
}
5 (Optional) Add this text in the Comment field:
This rule is only fired if none of the previous Knockout Rules have
been triggered. If this rule is fired, the decision.status is changed
from "pending" (the variable’s default value) to "qualified".
6 Save your changes and close the Ruleset Editor.
Tip: You can copy the SRL from this document and paste it into the Function body field. Be
sure to use straight quotes for any quotation marks in the Blaze Advisor IDE.
// Test case # 3 - an invalid policy from an applicant with too many annual miles
//thePolicy is some AutoPolicy initially
AutoPolicy.readAutoPolicy(NdProductInfo.getInstallDirectory(NdProductInfo.PRODUCT
_ADVISOR_TUTORIALS)"/tutorials/testData/rs_invalid_miles.xml").
// Test case # 4 - an invalid policy from an applicant with too many moving
violations
//thePolicy is some AutoPolicy initially
AutoPolicy.readAutoPolicy(NdProductInfo.getInstallDirectory(NdProductInfo.PRODUCT
_ADVISOR_TUTORIALS)"/tutorials/testData/rs_invalid_violations.xml").
apply KnockoutRuleset(thePolicy).
print("Status is: "thePolicy.DecisionInfo.status).
if thePolicy.DecisionInfo.ReasonText.count > 0 then {
for each string in thePolicy.DecisionInfo.ReasonText do {
print("Reason for disqualification: "it).
}
}
Note: Each test case block contains a line that begins with thePolicy or //
thePolicy. Each of these lines wraps to the next two or three lines due to space
limitations in this document. For each test case, enter all the lines on the same line in the
function body. It is important that there are no line breaks in each of the test cases. In
addition, the inital comment for Test case # 3 and Test case # 4 also wraps and needs to
be entered on one line. Finally, Test cases # 2 - # 4 are intentionally commented out.
6 Save your changes and close the Function Editor.
Each test case is using the readAutoPolicy method to read in test data. In addition, the
getInstallDirectory method of the NdProductInfo class is used to obtain the
Blaze Advisor installation directory to create the correct path for the location of the test
data.
A local parameter, called thePolicy of AutoPolicy type, references the test data. The
apply keyword is used to invoke the Knockout Ruleset you created and uses thePolicy
as the argument.
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Ruleset Tutorial Run Configuration is automatically run with the Run
As command because there is a matching configuration for the currently selected
project. If you receive a message stating there are no recent launches, then select Run >
Run History > (number) Ruleset Tutorial Run Configuration, where (number) represents
the numeral associated with one of the previous configuration runs.
8 Double-click on the main() function in the Project Explorer. In the Function body, place a
comment (double forward slashes—//) in front of the line that begins with thePolicy
is some AutoPolicy.
In the next test case block, remove the comment from the line that begins with
//thePolicy is some AutoPolicy. It is important that only one occurrence of this
line is enabled; otherwise an error will occur.
Note: The line in each test case that begins with thePolicy is some AutoPolicy
may wrap to the next line or two, depending on the width of your function editor. If the
line wraps, you only need to add and remove comments from the first line.
Tip: To view fresh results from the new run, click the Clear Console icon on the
Console toolbar to clear the results from the previous run.
9 Save the changes, and then run the project to observe the new output results.
10 Repeat the previous two steps until you have run all four test cases.
Execution complete.
rs_invalid_age.xml Status is: disqualified
Reason for disqualification: You are under the age of 16
and are too young to drive.
Execution complete.
Execution complete.
rs_invalid_violations.xml Status is: disqualified
Reason for disqualification: You have 5 moving
violations and only 4 are allowed.
Execution complete.
Summary
In this tutorial, you performed these tasks:
Used the Ruleset Editor to create the Knockout Ruleset.
Used the Function Editor to create a main() function.
Built and ran the project using test data.
Evaluated the generated output with expected output data.
For testing purposes, the ruleset was invoked by the main() function. However, in the
completed tutorial, the ruleset is invoked from a ruleflow.
The ruleset you created replicates the one in the completed tutorial. To see how the ruleset
works in relationship to the other entities in the completed tutorial, use the Repository
Explorer to open the Data Validation Ruleflow Testing project under this directory:
Auto Policy Rules\Testing\Rule Service Testing\Data Validation Ruleflow
Testing Folder.
In the project, expand the Data Validation Ruleflow folder, and double-click on Data
Validation Ruleflow. You see the ruleflow, which is the execution flow, for the part of the
project where the Knockout Rules are used as the first task in the ruleflow. The results of the
Knockout Rules are sent to the decision block. The decision block determines the next step
in the ruleflow which needs to process the information on whether the status is disqualified
or not.
See Also: For more information, see “Rulesets and Rules” in DevelopingRuleProjects.pdf.
This FICO® Blaze Advisor® decision rules management system tutorial shows you how to
use the Decision Table Wizard to create a decision table.
A decision table is a graphical representation of a ruleset that allows your business users to
easily create and maintain rules using a tablular format. A decision table represents several
rules, all using the if-then construction. Data validation is provided for each cell, which
reduces the likelihood of errors at runtime.
This figure shows a partial view of the decision table you will create:
Suppose that you are a member of a development team that has been assigned the task of
creating a decision table to evaluate applicant data and assign a value tier. Value tiers are
used to calculate insurance premiums based on the driving record of an applicant and other
related data. Value tier 1 is considered the best tier, and this tier is only assigned to good
drivers.
By the time the data passes to the decision table in the ruleflow, a set of rules has been
applied to eliminate insurance applicants who do not qualify for insurance, and a score
model has calculated a score for the degree of risk an applicant represents. The risk score is
then passed to the next entity in the ruleflow, which is the decision table you are going to
create. The decision table evaluates the incoming data and assigns a value tier based on the
risk score and the driving record of the applicant. The value tier is a rating that is assigned to
insurance applicants and is used to calculate the insurance premium. In this scenario, the
value tier is passed to a set of rules that applies any discounts and determines the insurance
premium that the applicant will pay.
Imagine that after the risk score is determined by the score model, the risk score is passed to
the decision table. Customers with a good risk score, who have had no accidents, are
immediately assigned a value tier. The data for customers who have had one or more
accidents are evaluated further using conditions that relate to the accident information.
In all cases, the cell at the end of each row contains an action expression. For this project, the
action is to assign a value tier. Note that a Single-axis decision table can have more than one
action. For this project only one action is required.
Prerequisites for this tutorial: You should have a basic understanding of how to use the
Blaze Advisor IDE. If you are new to Blaze Advisor, complete the “Introductory Tutorial” or
review the Blaze Advisor documentation.
Estimated time to complete: 60 minutes
Role of the decision table in the AutoPolicy scenario: In a real-world situation, a decision
table is just one component of a rule service. While you are completing this tutorial, assume
that you are part of a project team assigned to create the decision table that will evaluate
applicant data and assign a value tier.
The decision table will be created in a separate folder and tested. After the decision table is
completed, it becomes integrated into the project. In this tutorial, you will just create the
decision table and then view how it is used in the completed project.
To view the completed version: At any time, you can import and view a completed version of
the decision table. The completed version is the Tier Placement Decision Table
Template Development project. See “Working in the Decision Table Tutorial Project” on
page 89.
See Also: For more information, see “Creating and Deleting References to Folders or
Subprojects” in DevelopingRuleProjects.pdf.
To open the project and include the AutoPolicy BOM and Utilities
folders
1 Select File > Import, expand the Blaze Advisor folder, select Rule Project, and click Next.
2 In the Select Repository wizard page, select Feature Tutorials Repository and click Next.
3 In the Select a Blaze Advisor Project wizard page, expand the Decision Table Tutorial
folder, select the Decision Table Tutorial Project, and click Finish to open the
project.
4 In the Project Explorer, right-click the Decision Table Tutorial Project [Feature
Tutorials Repository] project and select Open Project Editor.
5 Use one of these options to open the Include Folder or Project dialog.
Click the Include Folder or Project icon in the Project Editor.
Select Project > Include Folder or Project....
6 Expand Auto Policy Rules\Technical Library\Business Object Models and
select the Auto Policy XML BOM folder. Click Include to include this item in the project.
7 Open the Include Folder or Project dialog again and this time expand Auto Policy
Rules\Technical Library and select the Utilities folder. Click Include to include
this item in the project.
8 If the File > Save command or the Save icon is enabled, save your changes.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project... command does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
9 Select File > Refresh to update the contents of the repository.
The AutoPolicy XML BOM and Utilities folders are now included in the Decision Table
Tutorial Project. The full path to these folders appears in the Project Editor. In the Object
Model Explorer, you can expand the AutoPolicy XML BOM and Utilities folders to see the
classes contained in them.
Tip: If the folders do not display in the Object Model Explorer, build the project by
selecting Project > Build Project.
type parameter, variable, object or pattern created in the wizard or available in the
project.
A static cell group is one that is based on a specific property, parameter, or variable of a
primitive or enumeration type. You can select the expression formats for the cell group in
the wizard. The condition expressions are generated at the time the Decision Table
Template is generated.
You will use the wizard to create both dynamic and static cell groups.
Tip: You can widen the Available Conditions panel to read the contents more easily.
4 In the Display Name field, double-click in the field and change the name to: Accident
Type
5 Repeat Steps 3 and 4 to add two other properties from anyAccidents.
BodilyInjuriesInd - Use Bodily Injuries for the display name.
AtFaultInd - Use At Fault for the display name.
6 Click Next.
Because this expression will only be used for two rules, it will not be the default. The
default will be the first expression, Value_Tier1_Assignment, which contains the SRL
that includes the ignore() built-in function.
9 Save the changes.
5 Expand All Entities, expand thePolicy parameter and select this property:
Customer.DrivingRecord.AnyAccidentsinLast3Years.
6 In the Display Name field, shorten the name to the following:
Any Accidents in 3 Years
7 Click OK.
The decision table structure should look like this:
can only run one test file at a time. To run a different test file, simply comment out the active
line in the main() function and remove the comments from another line.
A local variable called thePolicy of AutoPolicy type references the test data. The apply
keyword is used to invoke the decision table you created and uses thePolicy as the
argument. When the evaluation is completed, a value tier is displayed in the Console view.
Tip: For subsequent runs, you can do any of the following: click the Run icon on the
Launch toolbar, select Run > Run, or right-click the project in the Project Explorer and
select Run As > 1 Blaze Advisor Project. The Decision Table Tutorial Run Configuration
is automatically run with the Run As command because there is a matching
configuration for the currently selected project. If you receive a message stating there
are no recent launches, then select Run > Run History > (number) Decision Table
Tutorial Run Configuration, where (number) represents the numeral associated with one
of the previous configuration runs.
7 Place a comment (double forward slashes—//) in front of the first line in the main()
function and remove the comments from the next line that references an XML data file,
such as DTable_HighValAccidents.xml.
Note: The first line in each test case begins with thePolicy is some AutoPolicy
initially and may wrap to the next line or two, depending on the width of your
Function Editor. If the test case wraps, you only need to add and remove comments from
the first line of the test case.
8 Run the project to observe and compare the new output results.
9 Repeat the previous two steps until you have run all the test cases.
Note: Customers with different Risk Scores may be assigned similar Value Tiers depending
on the number and the types of their accidents.
See Also: For more information, see the “RMA Tutorial” on page 134.
Summary
In this tutorial, you created a decision table that replicates the one in the completed tutorial.
To see how the decision table works in relationship to the other entities in the completed
tutorial, import this project:
/Auto Policy Rules/Testing/Rule Service Testing/Policy Underwriting.
You see the Policy Underwriting Ruleflow, which controls the execution of the rules. You see
that the Tier Placement task appears after the decision block. The results of the Tier
Placement task are sent to the next task for further evaluation.
In this tutorial, you performed these tasks:
Used the Decision Table Wizard to create a Decision Table Template
Modified the Decision Table Template
Generated an instance of the template
Imported data into the condition and action cells in a Decision Table Template Instance
(also known as a decision table)
Built and ran the project using test data.
Viewed the generated output.
In this tutorial, the decision table is invoked by the main() function for testing purposes. In
the completed tutorial, the decision table is invoked from a ruleflow. You can also invoke a
decision table from a function, ruleset, or another decision table.
See Also: For more information about decision tables, see “Decision Tables” in
DevelopingRuleProjects.pdf.
This FICO® Blaze Advisor® decision rules management system feature tutorial shows you
how to generate a score model using the Score Model Wizard and how to write rules using
the Score Model Instance Editor. You will also learn how to test the score model using test
data and how to print the generated score and score reasons.
A score model is a graphical representation of a mathematical formula used to predict the
likelihood of future behavior about a business customer or prospect, based on facts known
about them in the present. In this tutorial, the score model generates a score based on the
age of the applicants, the length of time they have held a license, and the number of
accidents and moving violations they have had in the past three years. In the completed
version of the project, the score evaluates the applicant data before it is passed on to the
next task in the ruleflow, which is the decision table. See the “Decision Table Tutorial” on
page 88 and the “Ruleflow Tutorial” on page 141.
The following figure shows a partial view of the score model you will create in this tutorial:
You can see that various data points (called Characteristics) are considered in the score
model. In this tutorial, Age, Years Licensed, Num of Accidents, and Num of Moving Violations
are the characteristics. These characteristics are based on properties in the AutoPolicy
object model, which is a series of XML classes.
Each characteristic is divided into bins, which represent the possible values of the
characteristic. For example, Age is divided into Young Adult, Adult, and Senior age ranges.
These bins are rule conditions that must be mutually exclusive and collectively exhaustive,
so that the value for each characteristic can only fall into one bin. Blaze Advisor provides the
All Other bin for each characteristic to ensure all possible values are covered.
When you enter data into the score model, Blaze Advisor generates rules. Incoming data is
tested against the rule conditions (bins) and a partial score is assigned to each
characteristic. The score model returns a score that is simply the sum of the partial scores.
At runtime, the rules in the bins resolve to a ruleset representing the score model.
Prerequisites for this tutorial: You should have a basic understanding of how to use the
Blaze Advisor IDE. If you are new to Blaze Advisor, complete the “Introductory Tutorial” on
page 13 or review the Blaze Advisor documentation.
Time estimate: 60 minutes
Role of the score model in the AutoPolicy scenario: In a real-world situation, a score model
will be just one component of a rule service. While you are completing this tutorial, assume
that you are part of a project team assigned to create the score model that will evaluate
applicant data and assign a risk score.
The score model will be created in a separate folder and tested. After the score model is
completed, it becomes integrated into the project. In this tutorial, you just create the score
model and then view how the score model is used in the completed project.
To view the completed version: In the IDE, you can view a completed version of the score
model at any time. The completed version is located in the Risk Score Template
Development project under this directory: Auto Policy Rules\Testing\Unit
Testing\Risk Score Template Development Folder. See “Opening the Score Model
Project and Including the XML BOM and Utilities Folders” on page 103.
Open the project file and you will see the AutoPolicy Object Model,
Risk_Scores_Reason_Codes reason code list, Risk Score Model Template, an instance of the
Score Model Template, and a main function. The template instance is the actual score model
that contains the rule values.
To open the project and include the AutoPolicy BOM and Utilities
folders
1 Select File > Import, expand the Blaze Advisor folder, select Rule Project, and click Next.
2 In the Select Repository wizard page, select Feature Tutorials Repository and click Next.
3 In the Select a Blaze Advisor Project wizard page, expand the Score Model Tutorial
folder, select the Score Model Tutorial Project, and click Finish to open the project.
4 In the Project Explorer, right-click the Score Model Tutorial Project [Feature
Tutorials Repository] project and select Open Project Editor.
5 Use one of these options to invoke the Include Folder or Project dialog box.
Click the Include Folder or Project icon in the Project Editor.
Select Project > Include Folder or Project....
6 Expand Auto Policy Rules\Technical Library\Business Object Models and
select the Auto Policy XML BOM folder. Click Include to include this item in the project.
7 Open the Include Folder or Project dialog box again and this time expand Auto Policy
Rules\Technical Library and select the Utilities folder. Click Include to include
this item in the project.
8 If the File > Save command or the Save icon is enabled, save your changes.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project... command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
9 Select File > Refresh to update the contents of the repository.
The AutoPolicy XML BOM and Utilities folders are now included in the Score Model
Tutorial Project. The full path to these folders appears in the Project Editor. In the Object
Model Explorer, you can expand the AutoPolicy XML BOM and Utilities folders to see the
classes contained in them.
Tip: If the folders do not display in the Object Model Explorer, build the project by
selecting Project > Build Project. The folders should now appear.
7 Repeat the previous steps to add two more reason codes using the following values:
8 Use the Move Up and Move Down arrows on the Reason Code List Editor to move the
three new reason codes above Unexpected. The codes should follow this sequence:
No_violations, Some_violations, Many_violations.
9 Save your changes and close the editor.
Creating Characteristics
In this section, you will create four characteristics for your score model (Age, Year Licensed,
Num of Accidents, and Num of Moving Violations).
Each characteristic can contain more than one version of the expression used to evaluate the
class property. For example, every rule coming from the Age characteristic represents one
condition expression. However, the actual construction of the condition expression may vary.
In this tutorial, you will use two variations of Age expressions:
thePolicy.Customer.PersInfo.Age > {integer1} and
thePolicy.Customer.PersInfo.Age <= {integer2}
thePolicy.Customer.PersInfo.Age > {integer}
Tip: You can widen the Expression column to read the contents more easily.
By selecting a reason code list, you are asking Blaze Advisor to return reason codes along
with the score. Returning reason codes is a useful way to track or report reasons that most
affect a score either positively or negatively. Reason codes are returned based on either their
order (rank) in the reason code list or by computing distances from a baseline or maximum
score. For this tutorial, you will use the default behavior that is to return score reasons based
on their rank.
Tip: If the Add Bin button is not enabled, click on the first cell in a bin row.
3 Click in the Bins column and enter:
Young adult
This will be the name of the first bin in the characteristic.
4 Click in the Range column to enable the Select a format icon .
5 Click the Select a format icon and select Age ‘integer1’ < .. <= ‘integer2’.
6 Enter the following numbers in the Range column:
a Click the first field and change it to 16
b Click in the second field and change it to 24
Note: The data validation checking may temporarily change the font color to red.
7 (Optional) In the Description field, enter descriptive text such as Young driver. Any text
in the Description field is only visible in the Score Model Instance Editor and cannot be
printed like the reason messages.
8 Retain Young in the Reason Code column. The associated message is filled in
automatically.
9 Click in the Score column and enter 125 for the score weight.
10 Complete the other two bins for the Age characteristic and enter the following values:
You do not need to add text into the Description field for each bin. It is an optional task in
this tutorial.
11 Verify that the Unexpected check box is selected in the All Other bin. This indicates that
no values are expected to fall into that category.
12 Select Unexpected as the Reason Code for the All Other bin. Notice that Unexpected
data automatically displays in the Reason Message column.
2 Verify that the Unexpected check box in the All Other bin is checked.
3 Select Unexpected as the Reason Code for All Other.
2 Verify that the Unexpected check box in the All Other bin is checked.
3 Select Unexpected as the Reason Code for All Other.
2 Verify that the Unexpected check box in the All Other bin is checked.
3 Select Unexpected as the Reason Code for All Other.
4 Save the changes to the Score Model Instance Editor.
5 If the Score Model Tutorial Project does not appear in the Project to Run field, perform
the following steps to complete the run configuration for this project:
a Click Select Project... to open the Blaze Advisor Project dialog box.
b Select Score Model Tutorial Project [Features Tutorial Repository] and click OK.
6 Click Apply to save your edits.
7 Click Run from the Run Configurations dialog box.
Compare your results in the Console view to the Output Results column in the table in the
next section.
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Score Model Tutorial Run Configuration is automatically run with
the Run As command because there is a matching configuration for the currently
selected project. If you receive a message stating there are no recent launches, then
select Run > Run History > (number) Score Model Tutorial Run Configuration, where
(number) represents the numeral associated with one of the previous configuration runs.
8 Place a comment (double forward slashes—//) in front of the first line in the main()
function and remove the comments from the next line that references an XML data file,
such as SM_AdultAccidnt-NoMV.xml.
Note: The first line in each test case begins with thePolicy is some AutoPolicy
initially and may wrap to the next line or two, depending on the width of your
function editor. If the test case wraps, you only need to add and remove comments from
the first line of the test case.
9 Run the project to observe the new output results.
10 Repeat the previous two steps until you have run all the test cases.
Notice that an applicant can receive the same total score even when their ranks and reason
codes for each characteristic differ.
2 Double-click the Risk Score Model Template Instance ruleset to open the rules created
for the model, including initial characteristic values, return information, and the rules for
each bin.
3 In the Contents section, expand a rule to view the SRL.
You will see that by entering values in the score model you have created several new
rules.
See Also: For more information about modifying the code templates, see “Modifying Score
Model Attributes” in DevelopingRuleProjects.pdf.
Summary
In this tutorial, you created a score model that replicates the one in the completed tutorial. To
see how the score model works in relationship to the other entities in the completed tutorial,
use the Repository Explorer to open the Policy Underwriting project under this directory:
Auto Policy Rules\Testing\Rule Service Testing\Policy Underwriting Folder.
In the Project Explorer, expand the Policy Underwriting Ruleflow folder, and double-
click on Policy Underwriting Ruleflow. This ruleflow is the execution flow for the part of
the project where the score model values are used. You see that the score model is the first
task in the ruleflow. The score is then passed to the next ruleflow task, the SetScore
function.
Templates Tutorial
This FICO® Blaze Advisor® decision rules management system tutorial shows you how to
convert a ruleset, which is a fixed SRL entity, to a Ruleset Template with editable rule values.
The rule values can be edited in the Instance Editor in the Blaze Advisor IDE or in a rule
maintenance application (RMA).
You will learn how to do the following:
Convert the ruleset to a Ruleset Template in the Blaze Advisor IDE.
Create a Rule Template that can be used to create multiple versions of the same rule.
Replace SRL with editable rule values and specify how the values will be displayed.
Generate an instance file to store the values.
Edit the rule values in the Instance Editor. For information on editing values in an RMA,
see the “RMA Tutorial” on page 134.
At the end of this tutorial, you will have created a template, and an instance that contains a
rule table to organize and edit the rules, as shown below:
Prerequisites for this tutorial: You should have a basic understanding of how to use the
Blaze Advisor IDE. If you are new to Blaze Advisor, complete the “Introductory Tutorial” on
page 13, the “Ruleset Tutorial” on page 76, or review the Blaze Advisor documentation.
Time estimate: 40 minutes
Role of the instance in the completed tutorial: In this tutorial, assume that you are part of a
project team that has been asked to make some of the rules in a particular ruleset editable in
the Instance Editor or in an RMA.
To view the completed tutorial: In the IDE, you can view a completed version of the project at
any time. The completed version is located in the Auto Policy RMA project under this
directory: Auto Policy Rules/Testing/Unit Testing/Pricing Rules Development
Folder. See “Opening the Templates Tutorial Project” on page 118.
Important: You must delete the original Pricing Ruleset so the project can build. When
you instantiated the Pricing Ruleset Template with the Derive Template command, this
new instance contained the same content as the original Pricing Ruleset. This resulted in
two Pricing Rulesets in the project and the duplication prevents the project from
compiling.
5 Save your changes.
if thePolicy.Coverage.CoverageCd = CoverageTypeCode.Comprehensive
then premium = 75.00.
if thePolicy.Coverage.CoverageCd = CoverageTypeCode.Loss_of_Use
then premium = 100.00.
A Rule Template allows you to create multiple versions of the same rule with different rule
values. Because the construction of these rules is similar, you will create one rule with
editable values in a Rule Template.
Note: You can open the Rule Template from the Project Explorer or from the
PricingRulesetTemplate Editor.
6 In the Rule Template field, delete the default name and enter:
setPremiumRuleTemplate
7 Under the SRL Editor section in the rule template, enter this SRL code in the Body field:
if thePolicy.Coverage.CoverageCd =
then premium = .
8 Save the changes and leave the template open.
The ruleNameVHolder allows one entry of type String because each rule can have one
name only.
Note: All Value Holders appear in the Value Holders and Arguments section at the top of
the Rule Template Editor.
Important: The Value Holders must be enclosed in single quotes or the project will not
build.
2 Place your cursor between the single quotes, and click the Insert Placeholder icon in
the Rule Template toolbar.
3 In the Placeholder Wizard, select Create a new Value Holder.
4 In the Name field, enter:
startDateVHolder
5 Enter Start Date in the Display Name field.
6 Verify that Select a built-in template or provider is selected in the drop-down list.
7 Select date-provider in the provider list, and click Next.
8 Retain Exactly 1 in the Value Holder Count drop-down list, and click Finish.
9 Repeat the previous steps for the To field, and name the second Value Holder
endDateVHolder, with a display name of End Date, as shown in the following figure:
Note: It is not required that you create a display format for your template, but it is
recommended as a best practice. If no display format is specified, the Value Holders appear
in the instance file in the same order in which they appear in the Value Holder and
Arguments section in the template.
6 Save the changes and close the setPremiumRuleTemplate rule template. The
PricingRulesetTemplate Editor should be visible again.
6 From the Value Holder Count drop-down list, select 1 or More, and click Finish.
7 In the Content section, delete the following rules from the PricingRulesetTemplate:
setPremium_Bodily_Injury
setPremium_Comprehensive
setPremium_Loss_of_Use
These rules are no longer needed because you will be creating rules based on the Rule
Template.
3 Press Enter twice to create space after the text, and save the changes.
This option provides filters for searching on values in rule table columns.
5 Retain the other values and click OK.
Note: The Insert Column icon is now activated in the toolbar when your cursor is within
the Value Holder.
2 In the Column Header field of the Column Attributes dialog box, type Rule Name and
click OK.
3 Leave the cursor within the column header where it appears, and click the Insert
Placeholder icon in the toolbar.
This is a partial view of how the Display Format field should appear:
Note that the cursor is between the yellow and the blue fields. Press the right arrow key
once to move it past the blue field. This action activates the Insert Column icon in the
toolbar.
The Visual Instance Editor displays the instance file as it would appear in an RMA. This is
the default view.
The Tabular Instance Editor displays the instance file values in a tabular format.
In this tutorial, you will edit the values in the Visual Instance Editor. For more information, see
“Managing Instances” in DevelopingRuleMaintenanceApplications.pdf.
Note: The default date in the Start and End date fields in your instance should be the
current date.
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Templates Tutorial Run Configuration is automatically run with the
Run As command because there is a matching configuration for the currently selected
project. If you receive a message stating there are no recent launches, then select Run >
Run History > (number) Templates Tutorial Run Configuration, where (number)
represents the numeral associated with one of the previous configuration runs.
Summary
In this tutorial, you took an existing ruleset and converted it to an editable, user-friendly rule
table that can be accessed easily, both in the Blaze Advisor IDE and in an RMA.
See Also: For more information on how to generate an RMA for this project and edit values
in an RMA, see the “Ruleset Tutorial” on page 76.
This FICO® Blaze Advisor® decision rules management system feature tutorial shows you
how to generate a rule maintenance application (RMA). An RMA is a web-based, graphical
user interface (GUI) that allows business users to edit business rules in an intuitive, domain-
specific environment. The RMA that you will generate will allow you to edit values in a display
table, a score model, and a decision table using a web browser.
When you create a rule project, you can create templates that expose specific values or sets
of values that can be edited through the RMA. The actual values that are entered using the
Blaze Advisor IDE or an RMA are stored in separate repository entries called instance files.
When the project is run, or deployed as a service, the instance values are resolved according
to the template definitions to produce valid, functional decision entities. For example, a
Decision Table Template and an instance of a Decision Table Template together form a fully
resolved (decision table) ruleset at runtime.
Prerequisites for this tutorial: You should have a basic understanding of how to use the
Blaze Advisor IDE. If you are new to Blaze Advisor, complete the “Introductory Tutorial” on
page 13 or review the Blaze Advisor documentation.
Time estimate: 20 minutes
Role of the RMA in the completed tutorial: In a real-world situation, a rule maintenance
application (RMA) is just one way to edit instance values. You can choose to edit some
values in the Blaze Advisor IDE, and others you can expose to your business users via the
RMA. While you are completing this tutorial, assume that you are part of a project team
assigned to create the RMA and want to expose only the display table, score model, and
decision table values to your business users. The pages necessary for editing the display
table, the score model, and the decision table that you are working on are part of a larger
enterprise-wide application.
To view the completed version: You can view a completed version of the RMA project at any
time. The completed version is located in the AutoPolicy RMA project under this directory:
Auto Policy Rules\Business Library\AutoPolicy RMA.
project items become part of the RMA project. In this tutorial, the AutoPolicy BOM folder
must be included because the decision table has conditions that use an XML enumeration
from this BOM.
Tip: In the Blaze Advisor Perspective, changes are automatically saved when you make
them from the Project Explorer. For example, including a folder from the Project Editor
requires you to save changes, but including a folder from the Project Explorer, using the
Project > Include Folder or Project... command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
10 Select File > Refresh to update the contents of the project. The project should now look
like this in the Project Explorer:
Tip: If you do not specify a web browser, Blaze Advisor uses the default browser for your
machine. To specify the web browser that you want to use with Blaze Advisor, see
“Blaze Advisor General Preferences” in DevelopingRuleProjects.pdf.
Important: Do not close the Blaze Advisor IDE while you are running the RMA. Because
the RMA was opened from the Blaze Advisor IDE, the Apache Tomcat web server will
stop if the IDE is closed.
The pane on the left is the tree view of the Explore pane. The pane on the right shows the
same structure in a tabular view. You can expand a folder and open an instance file in either
view.
4 In the first row, click in the Risk Score cell and change the range to 650-750, and click
OK. In the Value Tier cell, change the value to Five.
5 Click the Save icon .
6 Click the Log off icon on the Global Command Bar.
7 In the Blaze Advisor IDE, select Project > Rule Maintenance Applications > Stop
[FeatureTutorialsRepository.RMATutorialProject], and close the web browser.
This FICO® Blaze Advisor® decision rules management system feature tutorial shows you
how to use a ruleflow to control the flow of execution between related business tasks. Each
task is implemented by a Blaze Advisor ruleset, function, or decision metaphor such as a
decision table, decision tree, or score model. The Ruleflow Editor in the Blaze Advisor IDE
provides graphical tools for constructing and visualizing ruleflows.
In this tutorial you develop and test the Data Validation Ruleflow. The ruleset and function
that implement the business tasks are already built. You:
Define the data context.
Add the tasks in the sequence you want.
Add conditional branching.
Choose the implementation for each task and make parameter and return value
assignments.
Define a function to be used as the entry point for the service invocation when the
ruleflow has been deployed as a rule service.
Run the project with test data to verify that the flow is working properly.
Prerequisites for this tutorial: You should have a basic understanding of Blaze Advisor
functional entities such as rulesets, decision metaphors, and functions. Other tutorials for
developing these entities are available. See:
“Ruleset Tutorial” on page 76
“Score Model Tutorial” on page 101
If you are new to Blaze Advisor, complete the “Introductory Tutorial” on page 13 or review
the Blaze Advisor documentation.
Time estimate: 60 minutes
Role of the ruleflows in the Auto Policy scenario: All of the feature tutorials are based on a
hypothetical automobile insurance scenario. In this scenario, each of the ruleflows controls
the execution of a single rule service. For an overview of the two services, see “Rule
Services” on page 9. For an overview of the complete scenario, see “Overview of the
Features Tutorials Scenario” on page 8.
Each ruleflow is developed in its own project in the repository. The project refers to a folder
that contains the ruleflow itself, along with the entry-point function for the deployed rule
service. It also refers to all of the folders that contain the entities for implementing the
business tasks, and a folder that contains a main function for testing the ruleflow in the
Blaze Advisor IDE.
To view the completed version: In the IDE you can view the completed versions of each
tutorial project are included in the Auto Policy Rules folder in the Feature Tutorials
Repository. The Data Validation development project can be found under Auto Policy
Rules\Testing\Rule Service Testing\Data Validation Ruleflow Testing
Folder.
See Also: The Knockout Ruleset that you will reference in this tutorial is the subject of
the Ruleset Tutorial. See “Ruleset Tutorial” on page 76 for details.
3 If the File > Save command or the Save icon is enabled, save your changes.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
The Knockout Rules folder is now included in the Ruleflow Tutorial Project. The full path
to the folders included in the project appears in the Project Editor.
To add the Auto Policy XML BOM from the Technical Library
1 Use one of these options to invoke the Include Folder or Project dialog box.
Click the Include Folder or Project icon in the Project Editor.
Select Project > Include Folder or Project....
2 Expand Auto Policy Rules/Technical Library/Business Object Models,
select Auto Policy XML BOM, and click Include to add a reference to the project.
The Auto Policy XML BOM folder appears in the Project Explorer. The full path to this
folder appears in the Project Editor. In the Object Model Explorer, you can expand the
AutoPolicy XML BOM folder to see the classes contained in them. If you expand a class,
you can see its properties and methods.
Tip: If the folder does not display in the Object Model Explorer, build the project by
selecting Project > Build Project. The folder should now appear.
3 If the File > Save command or the Save icon is enabled, save your changes.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project... command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
Tip: In the Blaze Advisor Perspective, project changes are automatically saved when you
make them from the Project Explorer. For example, including a folder from the Project
Editor requires you to save changes, but including a folder from the Project Explorer,
using the Project > Include Folder or Project... command, does not.
See Also: For more information, see “Saving Changes to Projects and Project Items” in
DevelopingRuleProjects.pdf.
4 Select File > Refresh to update the contents of the repository.
The project now includes all of the entities you need except for the ruleflow itself and the
main function for testing it. You create these next.
Note: When a folder is selected in the Project Explorer, any new entities that you create
are added to it.
2 Click the New Ruleflow icon on the Blaze Advisor Entities toolbar, or select File > New
> Decision Entities > Ruleflow.
3 In the Entity name field, enter Data Validation and click Finish to open the Ruleflow
Editor. This is how the ruleflow appears:
objects. When an AutoPolicy object is posted, it is assigned to thePolicy and the ruleflow
starts.
2 Click in the text field next to Whenever a/an to enable the drop-down list, and select
AutoPolicy.
3 Select the entire Whenever a/an statement to enable the New Assignment icon , and
click the icon.
Tip: When you select the Whenever a/an statement, a blue outline of the statement
should display, as shown in the following figure:
4 Click to create the new task node, as shown in the following figure:
The KnockoutRuleset return type is void, so you can leave the Assign value returned
from implementation to field empty.
5 Close the Task Editor and save your changes.
4 Position the cursor on the lower branch of the split and click.
2 Click the New Function icon on the Blaze Advisor Entities toolbar, or select File > New
> Decision Entities > Function.
3 In the Entity name field, enter postApplication and click Finish to open the Function
Editor.
4 Click the New Parameter icon .
5 Replace parameter1 with policyElement.
6 In the Type field, replace object by entering Element.
Element is not available from the drop-down list since it is not an explicitly imported
class.
7 In the Function Body, enter these SRL statements:
events().postEvent(policyElement as an AutoPolicy).
executeAgent().
Note: The events() built-in function returns the internal event manager. The argument
to the postEvent() call performs the cast from Element to AutoPolicy. The cast is
valid as long as the top node of the Element is <AutoPolicy>. The executeAgent() built-
in tells the ruleflow to start monitoring the event channel.
8 Build the project to make sure the syntax is correct and then save your changes. The
postApplication() function should look like this:
Important: The first line in each test case begins with it[0], it[1] ... it[8] and wraps
to the next two lines due to space limitations in this document. For each test case, enter
all 3 lines on the same line in the function body. It is important that there are no line
breaks in each of the nine test cases.
Note: This code creates a fixed array of nine AutoPolicy objects and initializes it by
reading files from the testData folder in your Blaze Advisor installation. The
readAutoPolicy() method is a static method of the AutoPolicy class. All classes in
an XML BOM have a similar method for reading in xml files. In addition, the
getInstallDirectory method of the NdProductInfo class in the Utilities folder is
used to obtain the Blaze Advisor installation directory to create the correct path for the
location of the test data.
The for each block loops over all of the objects in the array and passes them as
Elements to the postApplication() function, and then prints the status value.
You cast the object to an Element because the postApplication() function is
expecting it to come in from an external application. Passing the object as an Element
more closely replicates an actual service invocation.
5 Select Project > Build Project.
A message appears in the Problems view confirming a successful build.
6 You need to create a run configuration before running the project. Select Run > Run
Configurations... to open the Run Configurations dialog box.
7 Select Blaze Advisor Project in the leftmost list of launch configuration types, and click
the New launch configuration icon on the toolbar.
You may need to scroll to see the Blaze Advisor Project in the list.
8 Enter Ruleflow Tutorial Run Configuration in the Name field.
9 If the Ruleflow Tutorial Project does not appear in the Project to Run field, perform the
following steps to complete the run configuration for this project:
a Click Select Project to open the Rule Project dialog box.
b Select Ruleflow Tutorial Project [Features Tutorial Repository] and click OK.
10 Click Apply to save your edits.
11 Click Run from the Run Configurations dialog box.
Tip: For subsequent runs, you can click the Run icon on the Launch toolbar, select
Run > Run, or right-click the project in the Project Explorer and select Run As > 1 Blaze
Advisor Project. The Ruleflow Tutorial Run Configuration is automatically run with the
Run As command because there is a matching configuration for the currently selected
project. If you receive a message stating there are no recent launches, then select Run >
Run History > (number) Ruleflow Tutorial Run Configuration, where (number) represents
the numeral associated with one of the previous configuration runs.
12 Save your changes.
The three files with invalid in the name will be disqualified, while the six valid files will
have a status value of pending, as shown in the following figure:
This FICO® Blaze Advisor® decision rules management system tutorial shows you how to
deploy a rule service into your application architecture so that client components can invoke
the service with data to be evaluated by the rules. Rule services are managed by an
implementation of the Blaze Advisor Rule Server. In this tutorial you will:
Create reusable deployment entities
Deployment configuration settings are specified in reusable deployment entities which
are used by a wizard to generate the configuration and class files needed for
deployment. The deployment entities allow you to set the configurations once and to use
them to deploy the project as often as required.
Release a copy of a project
Blaze Advisor includes a Release Project feature that lets you create a copy of a project
in a separate folder. When a version of a project is ready to be deployed, you can release
it and use the released copy for your deployment while continuing to develop the original
project.
Use the Generate Deployment Wizard command to create:
Rule server code
Server configuration file
Simple client code that shows how to invoke the service through the server
Application code for launching the server, creating a client, and invoking the service
from the client
Modify the client code to read in XML files and pass them to the service
Run the application
Prerequisites for this tutorial: You should be familiar with the Java programming language
and have a basic understanding of client and server programming concepts.
If you are new to Blaze Advisor, complete the “Introductory Tutorial” on page 13 or review
the Blaze Advisor documentation.
Time estimate: 60 minutes
Role of the deployment in the Auto Policy scenario: All of the feature tutorials are based on
a hypothetical automobile insurance scenario. This tutorial deploys the Data Validation rule
service, which is responsible for evaluating the data input by a customer applying for an
insurance policy. This evaluation determines if there are any obvious reasons for rejecting
the application. For an overview of the service, see “Rule Services” on page 9. For an
overview of the complete scenario, see “Overview of the Features Tutorials Scenario” on
page 8.
To view the completed version: In the IDE, you can view the completed versions of each
tutorial project are included under the Auto Policy Rules folder in the feature tutorials
repository:
The Data Validation development projects can be found under Auto Policy Rules/
Testing/Rule Service Testing/Data Validation Ruleflow Testing Folder.
The released version of Data Validation can be found under Auto Policy Rules/Rule
Services/Data Validation.
See “Opening the Deployment Tutorial Project” on page 156.
The complete deployment application is included in your Blaze Advisor installation at
<ADVISOR_HOME>/tutorials/deploymentsAutoPolicy/dataValidation. A
DeploymentDocumentation.html file with instructions for running the deployment application
is included in the folder.
The assumption is that all of the service components have already been developed and
tested. You are ready to create the deployment entities and to deploy the project. If you
compare this tutorial project to the Data Validation Ruleflow Testing Project in
the Auto Policy Rules/Testing/Rule Service Testing/Data Validation
Ruleflow Testing Folder of the repository, you see that they refer to the same folders,
with one exception. The Ruleflow Testing project includes a reference to Data
Validation Ruleflow Testing Folder, which contains the main() function used for
testing the ruleflow. For this deployment, the main() function should not be included.
Instead, you will define a rule service entry point that will call the postApplication()
function, which is contained in the Data Validation Ruleflow folder, when the service is
invoked.
More details about the entry point are described later. Note that this project represents a
fully tested, runnable rule service that is ready to be deployed.
Note: For simplicity, this tutorial uses many of the default values in the deployment entities.
For information on other deployment options, see “Generating Rule Services” in
DeployingRuleServices.pdf.
Note: The Entry Point ID field is automatically filled in after selecting the functional item.
See Also: For more information, see “Releasing Blaze Advisor Projects” in
DevelopingRuleProjects.pdf.
6 Leave the Filter field empty. This is an optional field that lets you apply a filter to include
some project items and not others when you release a project. See “Filtering Project
Content” in DevelopingRuleProjects.pdf.
7 (Optional) In the Comments field, erase the default text and enter your own comments.
8 Keep the Flatten unreleased subprojects option clear since this project does not contain
subprojects.
9 Clear the Check in new project release option. This option is only used to check in a
released project to a versioned repository.
10 Click Save.
11 Select Project > Close Project to close the project.
The released version of the project appears in the repository in the new folder you
created at Deployment Tutorial/Rule Services/Data Validation. It includes
copies of each folder referenced by the project. The copies have no connection to the
original folders from the Auto Policy Rules/Technical Library and the Auto
Policy Rules/Business Library. You will use the released version to deploy the
project.
Tip: To view the released project in the Repository Explorer, select Window > Show View
> Repository Explorer and then select the Feature Tutorials Repository.
Note: The second page of the wizard references the System Definition you created
earlier.
4 In the Target Directory field, change the path to
<ADVISOR_HOME>\tutorials\dataValidation, where <ADVISOR_HOME> is a variable
representing the location of the Blaze Advisor installation.
Note: This is where the configuration and class files will be generated. In addition, the
dataValidation folder will be created by the wizard.
Tip: You can determine the location of the parent folder containing the Blaze Advisor
installation by selecting Window > Preferences and then clicking Blaze Advisor in the left
panel. The install location of the parent folder displays in the right panel. The default is
for Blaze Advisor to be installed to a subfolder, called Advisor(version number). For
example, if you installed Blaze Advisor 7.8 to a parent folder of C:\Blaze, then
ADVISOR_HOME> is C:\Blaze\Advisor78.
5 Click Next to display the Generated Files wizard page. Keep the default selection of files
to generate and click Finish.
6 Click OK to dismiss the message listing the files that were generated.
This is a description of files in the directory:
Build.bat (Windows) or Build.sh (Unix).
This file checks to see if the correct environment variables are set and then compiles the
Java classes.
Client.java
The code in the Client class is responsible for obtaining the data to be evaluated by the
rules and invoking the rule service with it.
Data_Validation.server
The rule server configuration file.
DeploymentDocumentation.html
This file contains instructions for running the generated application. The Generate
Deployment Wizard always generates instructions for running the deployment files. A
sample one is included in this directory; however, to run the deployment for this tutorial,
follow the instructions in this document.
Run.bat (Windows) or Run.sh (Unix)
This file runs the application after using the Build script.
Runner.java
This file contains the application code that launches the server, creates a client instance,
and invokes the rule service through it.
Server.java
This file contains the code for the Blaze Advisor Rule Server implementation.
Before you build and run the application, you need to modify the client code to read in the
test data that you want to pass to the rule service.
Tip: JavaDoc API documentation is available for NdStatelessServer and the other rule server
classes by opening the <ADVISOR_HOME>/doc/api/packages.html file in a web browser
and clicking one of the Rule Server links.
Server.java adds one method to the base class. The postApplication() method calls the
service entry point you defined in the Rule Service Definition.
/**
* Invokes a server through the entry point "postApplication"
* in the service "Data Validation".
*
* @param arg0 ==> Enter a description here
*
*/
public void postApplication(org.w3c.dom.Element arg0)
throws NdServerException, NdServiceException, NdServiceSessionException
{
// Build the argument list
Object[] applicationArgs = new Object[1];
applicationArgs[0] = arg0;
The value of the Element argument is added to an Object array that is passed to the
invokeService() method, which is inherited from NdStatelessServer, along with the name
of the service and the name of the entry point. The service and entry point names correspond
to values stored in the Data_Validation.server configuration file.
Data_Validation.server is the server configuration file, and stores the configuration options
as xml values. The values conform to the settings from the Generate Deployment Wizard,
including the entry point you defined in the Rule Service Definition:
<DeployRulesServiceEntryPointConfig>
<AlwaysMapObjectsForDefaultModeRuleSets> false </
AlwaysMapObjectsForDefaultModeRuleSets>
<AlwaysMapPostedObjects> false </AlwaysMapPostedObjects>
<EntryPointId> postApplication </EntryPointId>
<SrlInvocationFunctional>
<SrlArgumentType> Element </SrlArgumentType>
<SrlName> postApplication </SrlName>
</SrlInvocationFunctional>
</DeployRulesServiceEntryPointConfig>
The static createServer() method of the Server class takes a String with the path to the
server configuration file as an argument, and returns a Server object that is instantiated with
the services defined in the configuration file, which are accessible through their entry points.
The server’s invokeService() method takes as arguments the name of the service, the
name of the entry point, and an Object array containing the entry point argument(s).
Client.java defines a simple client for the server. The constructor takes a reference to the
Server as an argument, and the postApplication() method calls the server’s
postApplication() method. There is also a private _postApplication() method that is
included as a convenience to make it easy to run and test the deployed files. The private
method is called by the run() method, which is called by the Runner described above. If you
add code to the private method that creates suitable data for invoking the server, you can use
the Runner to invoke the server.
3 Copy and paste these import statements under //==> Import Application
specific code here:
import org.xml.sax.*;
import org.w3c.dom.*;
import org.apache.xerces.parsers.*;
import org.apache.xml.serialize.*;
import org.apache.xerces.dom.*;
4 Scroll down to the private void _postApplication() method definition.
This method body consists of comments that serve as placeholders for the code you will
add to assemble the invocation data.
5 In the Client.java file, locate this code block:
private void _postApplication()
throws NdServerException, NdServiceException, NdServiceSessionException
{
//==> Set up the invocation arguments.
//==>org.w3c.dom.Element arg0 = (value for arg0);
//==> Invoke the actual method.
//==>postApplication(arg0);
}
6 Replace the code block in the previous step with the method definition, as shown in the
following code:
private void _postApplication()
throws NdServerException, NdServiceException, NdServiceSessionException
{
//==> Set up the invocation arguments.
org.w3c.dom.Element arg0;
DOMParser parser = new DOMParser();
try {
Document topNode = null;
}
The code reads two xml files from the /testData directory. The first file,
rs_invalid_age.xml, is processed and written to the /testData/
rejectedApplications directory. However, the file name that appears is a
combination of the firstName and lastName elements in the file so the name,
rs_invalid_age.xml, becomes UnderageDriver.xml.
The second file, valid1.xml file, is processed and is written to the /testData/
pendingApplications directory. However, the file name is ClemClamity.xml. When
this deployment is run, the file is updated and you can see that the timestamp for this file
is different from the other ones in the same directory.
7 Save the changes to the Client.java file.
Note: The following instructions are similar for Windows and Unix; however, these
procedures are for Windows.
:startrun
java Runner "./Rule_Service_Definition1.server"
3 Replace the code with this syntax:
:precompile
java -DADVISOR_HOME="%advisor_home%" Runner "./Data_Validation_ser.server"
goto finish
:startrun
java -DADVISOR_HOME="%advisor_home%" Runner "./Data_Validation.server"
This tutorial has not discussed the precompile option. However, it is available and you
can find information about it in the Blaze Advisor Rule Server documentation.
4 Save the modified file.