BestPractices For FICO Blaze (Java)
BestPractices For FICO Blaze (Java)
Best Practices
Version 7.4
Contents
CHAPTER 1:
Blaze Advisor Best Practices and Usage Patterns . . . . . . . . . . . . . . . . .5
Development Process Practices and Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Roles and Responsibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Business Analyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Application Architect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Object Model Architect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Rules Architect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Rules Writer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Repository Management Practices and Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Security Management Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Blaze Advisor Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Blaze Advisor Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Blaze Advisor Content At Rest Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Logging and Auditing Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Repository Content Organization Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
General Folder Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Business Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....... ......... 13
Technical Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Business Object Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Utility Templates and Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
SRL Entities and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Rules Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Technical Library Authoring Practices and Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
SRL Entity Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Rule Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Variable Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Constant Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Functional Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Template Entity Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
SRL Entity Formatting Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
SRL Entity Documentation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Writing Rules for Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Minimizing the use of Nested if-then-else Statements in Rules . . . . . . . . . . . . . . . . . 22
Comparing the use of Patterns Versus Quantified Expressions . . . . . . . . . . . . . . . . . . 23
Minimizing the use of Multiple Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Avoiding Repeated SRL Code in Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Business Analyst
The Business Analyst is responsible for defining the business processes which
will be supported and then gathering and organizing the business rules that
will provide the foundation for the application planning process. This list of
rules will typically be in the form of structured natural-language statements
that clearly, completely, and concisely express the rules, facts, policies, and
procedures that will be implemented. Once these statements are clearly listed,
the Business Analyst will work with the Object-Model Architect to identify the
objects (business data) which will be referenced by the rules. After the object
model and the control flow for the rule project have been set up, the Business
Analyst writes or modifies rules, either directly in the Blaze Advisor IDE or
through a rule maintenance application. However, for complex rule projects,
the implementation of the business rules could be the responsibility of the Rule
Writer.
Application Architect
The Application Architect is generally a senior developer on the project,
responsible for determining:
Scalability
Security
Persistence mechanisms
Where the rule service(s) will fit in the application architecture.
The appropriate invocation mechanism the application architecture will use
to invoke the business rules.
The general skill set for an Application Architect is:
Knowledge and experience designing application architectures.
Java/ OO programming
The customer’s network, middleware, server architectures and databases
used by the application.
Rules Architect
The Rules Architect is responsible for developing the rules project using
Blaze Advisor. This includes importing or creating the object model defined by
the Object Model Architect, designing the execution flow, and defining the
rulesets and functions. If the rule project includes a rule maintenance
application, the Rules Architect might also be responsible to develop the
templates and the user interfaces for the application.
The general skill set for a Rules Architect is:
The analytical skills to comprehend logical relationships
Familiarity with object-oriented terms and concepts.
Strong knowledge about the Blaze Advisor Rule Engine and best practices
about building high-performance rule projects based on various
Blaze Advisor artifacts.
Rules Writer
The Rules Writer (Rules Developer) is responsible for writing detailed rulesets
and Blaze Advisor source code constructs specifications, implementing them in
SRL, and perform unit testing on them.
The general skill set for a Rules Writer is:
Strong ability to understand business rule requirement documents and
capacity interact with business analysts to resolve issues regarding
business rule requirements.
Above average rule development skills using Blaze Advisor SRL.
Sufficient knowledge about the technology used to implement the
supporting object model such as Java, COBOL or XML to interact with the
object model architect and resolve potential issues between the object
model and the business rule implementation.
Using and reusing trusted components makes sense both from a resource
stance and from a security stance.
Use a Multi-tier Security Architecture for web applications.
Infrastructure considerations for web applications should be addressed to
limit exposure to internal resources as well as limiting the likelihood for
direct access to application data.
The following sections contain information on best practices for security in
Blaze Advisor:
“Blaze Advisor Authentication” on page 10
“Blaze Advisor Authorization” on page 10
“Blaze Advisor Content At Rest Management” on page 12
“Logging and Auditing Activities” on page 12
Identify the roles in the application. These typically can be obtained from
the use-case scenarios for the application where they are often represented
as the actors or subjects. It is important at this stage to identify hierarchies
as well. Applications must be coded to ensure users can be segmented by
role with appropriate authorization/privilege level assignments (Separation
of Duties). For a description of some typical Blaze Advisor roles, see “Roles
and Responsibilities” on page 6.
Identify the authorization constraints. This steps aims to bring the
resources, the actions/operations that may be performed on those
resources, and the roles together to define which roles can perform what
operations. For instance, you may want to limit your users with the
Business Analyst role to only editing instances in the RMA whereas you may
want your Rule Writer to have access to both the repository entities in the
Blaze Advisor IDE as well as the instances in the RMA.
Blaze Advisor provides an Authorization Manager interface that can be used to
implement authorization services for a repository. This Authorization Manager
interface can be written to check the login credentials stored in different types
of files, systems, or services to authenticate and authorize users.
The Blaze Advisor Authorization Manager framework is the proper mechanism
for registering an external system or building your own authorization system.
The Authorization Manager can be activated for any type of operation (create,
modify, delete, check out/in, promote, list…) on any entity by any user.
The Authorization Manager is registered at the repository level and therefore
applies to all connections including the Blaze Advisor IDE for the technical
users, such as the Rule Writer, and rule maintenance application for the
“Authorization Manager Example” on page 5 users, such as the Business
Analyst. See “Authentication and Authorization Manager Example” in the FICO
Blaze Advisor Help.
For fine-grained authorization management, the ideal solution is to manage the
user/group authorization in an external system such as LDAP or database.
Administrators can grant access to the entities in the repository as appropriate.
A synchronization mechanism must take place in order to reflect the content of
the repository in the external system.
In order to reduce the administration tasks, authorization management can
also be implemented as a routine based on groups. For example users can edit
anything that is owned by their group but have read-only or no access to rules
owned by other groups. This mechanism can be delegated to an external
system and be tailored to operate on management properties. As of today,
authorization manager implementations typically grant and restrict access per
folder and/or groups of files as file-level authorization management is viewed
as incurring too much administrative overhead .
If you want to provide authorization management at the rule maintenance
application mainly for your business users without configuring an Authorization
Manager at the repository-level, see “Managing Instances Using Life Cycle
Management” in DevelopingRuleMaintenanceApplications.pdf .
Business Library
The Business Library content is typically exposed to the business users when
they have the ability to navigate within the repository and open a selection of
files or projects.
We recommend that the folder structure follows a natural navigation scheme
for the business users. Both intuitive and systematic, such an organizational
breakdown will also immediately facilitate the understanding of the repository
by its main users, and will also simplify the security access down the road.
Depending on the expected usage of the repository through the projects and
organizations, other organizational guidelines may apply. For example, some
customers have organized their repository along the lines of their
organizational structure. Business users can then access only the specific rules
that apply to their business unit or territory/geography.
The fundamental recommendation is thus to start by considering the
management constraints that apply to the repository usage both short and long
term, and structure the repository along those lines. That will simplify both the
repository navigation for the business users, and the set up of the security and
partition policies by the administrators.
When the same business users maintain several projects, we recommend that
you list the project as the last classification. They will then have an easier time
navigating back and forth.
Technical Library
The Technical Library content is typically managed by the rules architect and
rules developers. The authoring of this content is done exclusively in the
Blaze Advisor IDE .
In this example, a ruleflow sequencing the various steps may be located in the
Underwriting directory. Each one of the steps could be further segmented with
the main function of ruleset at the top level, other functionals in one folder,
and templates in another folder.
Some SRL entities such as enumerations, global patterns, variables, and
generic templates should be located with the object model utility templates in
the Object Model folder.
Rules Services
In general terms, the deployment of rule services is the role of the technical
staff, and fairly independent of the work done by the Business Users. The
recommendation is to reflect that distinction in the organization of the
repository.
A rule service may require a specific signature or may receive a custom data
structure as a parameter. When writing this invocation stub, we recommend
that you externalize the template in its own deployment folder, called Rules
Services in the figure below.
Frequently, ruleflows are specific to rule services and can be organized
following the same principles. Ruleflows used in this way implement the
graphical weaving of various business rules entities into executable rule
services that can be deployed.
The primary benefit is to avoid repository pollution. When this information is
self-contained, the rules are independent of deployment artifacts and therefore
can easily be deployed in other projects. The deployment folder may contain
several folders with deployment templates for each target.
The deployment folders also contain the object model instance, the rule
instances, and the deployment instance. The files are referred to by the rule
server and/or deployment manager at runtime.
Testing
Prior to deploying a rule service, it is good practice to set up regression tests
for unit testing within the repository. Testing follows the same guidelines as
deployment:
Testing templates should be created. The testing templates may trigger the
testing of a single “rule” instance or chain all rulesets of the rule instances
in a testing ruleflow. The testing template is typically responsible for the
creation of test data.
Testing project files should include the object model instance, the rule
instances, and the testing instance. This project is used for testing in the
Blaze Advisor IDE .
This testing framework allows technical users to unit test the rules
maintained by the business users. The same data sample can be reused for
multiple rule projects.
Note These restrictions do not apply to ruleflow and task names. For those,
the user should select names that are the most meaningful from a business
point of view. Those names support blank spaces.
Example
The following rule does not take advantage of the rule inferencing engine:
if theApplicant’s salary is greater than $200,000
then {
if theApplicant’s homeownersStatus is true
then {
if theApplicant’s address’s state is (“CA” or “NY”)
then {
theApplicant’s offer = “Big City Offer”.
}
}
}
Example
This rule uses a pattern:
if anyBorrower’s FICO is less than 650
then
theApplication.justifications.append(anyBorrowers’s name “FICO score is less than
650”).
Example
This rule uses multiple patterns:
if (anyApplications’s amount is greater than $350,000
and anyBorrowers’s FICO is less than 650
and anyApplication.borrowers contain anyBorrower)
then {
anyApplication’s status = REFERRED.
anyApplication.justifications.append(anyBorrowers’s name “FICO score is less than
650”).
}
There are two simple strategies for reducing the number of patterns.
//If the rules are executed one application at a time, the first pattern is
//unnecessary. The rule can be re-written as follows:
if (theApplication’s amount is greater than $350,000
and anyBorrower’s FICO is less than 650
and theApplication.borrowers contains anyBorrower)
then{
theApplication’s status = REFERRED.
theApplciation.justifications.append(anyBorrower’s name “FICO score is less than
650”).
}
If the rule requires only one borrower under the 650 FICO limit, the rule can be
re-written as follows:
if (anyApplication’s amount is greater than $350,000
and at least one Borrower in anyApplication.borrowers
satisfied FICO is less than 650)
then {
anyApplication’s status = REFERRED.
anyApplication.justifications.append(“At least one borrower’s FICO score is less
than 650”).
}
Effective Dating
Effective dates are used for rules that are loaded at runtime and can be
activated/deactivated based on the execution time. This concept is very
important when transactions are not executed at the system clock time. The
execution date and time should sometimes be set by the application data.
Blaze Advisor provides built-in support for effective dates. Effective dates are
used to constrain the applicability of rules to only the those situations in which
the processing time matches the time period specified by the corresponding
clause. By default, the processing time taken into account by Blaze Advisor is
the system time on the machine it is executing on. However, the processing
time can be modified at any point in time in SRL and programmatically in Java
. Typically, the processing time will be set to a time that is logically derived
from the transaction data or objects, such as an application submission date.
This figure shows a rule that uses effective dates.
Effective dates can be exposed to the business user in the rule maintenance
application. In general, the business user has the capability to create one or
more copies of the same rule structure with different effective dates. The rule
structure can be a rule or a more complex entity such as a decision tree or a
decision table. In some cases, effective dates have been applied to process
flows.
Built-in Description
clock().timestamp() Reads the current processing date
clock().resetClock(“Nov 1, 2011”) Sets the processing date
Versioning
During the template design phase, the Rules Architect has the flexibility to set
the versioning granularity. Each value holder is a candidate for “independent
storage”. By clicking the Instances Stored Separately check box, the
technical user specifies that the content of this value holder should be
versioned and locked, independently from its parent structure. This figure
shows a value holder where the check box has been selected.
The level of granularity can be the rule service, the ruleset, or the rule. Entities
managed by different groups are managed independently and therefore
versioned independently. Typically rules that follow the “exception override”
pattern are likely candidates for rule level versioning.
Decision tables should be used when it is natural for the user community to
conceptualize their decisioning logic in a tabular (table-like) format. Also,
decision tables are the preferred editor when the decisioning logic is
symmetrical, which means that the rules share the same condition and action
terms. Decision tables provide a convenient way to visually validate that the
array of rules that are required have been covered.
The structure of decision tables is fixed. Business users can create any number
of rules but they must follow a given number of conditions and actions. Only
the format and the values in those conditions and action expressions can be
modified.
Decision trees should be used when it is natural for the user community to
conceptualize their decisioning logic in a hierarchical (tree-like) format. Also,
the rules share a subset of their predicate statements, but the decisioning logic
is (possibly) asymmetrical. Decision trees provides a convenient way to
visualize the different paths in a complex decision process.
The structure of decision trees is flexible. Business users can create rules that
follow a variable number of conditions and actions. The types of conditions and
actions is determined at design time but business users decide which
combination makes sense.
along the same path. Rules similar to the one in this example can be captured
in a decision graph as a series of conditions nodes ending with an action node:
if (theApplicant.totalIncome >= 40000 and
theApplicant.totalIncome < 50000) and
(theApplicant.isAHomeowner = “true”)
then {
theApplicant.recommendedCard = “Standard”.
}
Decision graphs differ from decision trees because they can be viewed and
edited in graph representations in addition to the Leveled Tree representation,
which is very similar to a decision tree. Decision graphs in Leveled Tree
representation and decision trees include only one branch leading into each
node. Decision graphs in a graph representation, however, can include multiple
branches leading into each node. As a result, decision graphs in a graph
representation usually have fewer nodes than trees have.
Like decision trees, decision graphs should be used when it is natural for the
user community to conceptualize their decisioning logic in a hierarchical
format. Also, the rules share a subset of their predicate statements, but the
decisioning logic is (possibly) asymmetrical. Decision graphs provide a
convenient way to visualize the different paths in a complex decision process.
These kinds of rules can be organized using the Score Model Editor. This editor
allows the user to create derived characteristics from the business object
model. It creates groups of tests that “bin” the objects in sections that have
well-defined score increments attached to them. The user can also manage the
audit information that allows the invocation to have a meaningful audit trail
that provides an explanation for the score reached.
Releasing a Project
There are several ways of dealing with release management. For some
customers, release management is about releasing rules from one staging area
to the next. For others, release management is about persisting a snapshot of
a given release of the project. That snapshot should contain sufficient
information for resurrecting that release. Blaze Advisor proposes two strategies
for dealing with this type of release management.
Tagging and “release as a copy” are complementary strategies where tagging
should be used for rule service-level release management and copying should
Release Location
Releases can be located anywhere in the repository or in another repository.
For ease of access, we recommend that you locate your released projects in the
folder named Releases and identify each one with a unique release number.
There are two main approaches you can use to determine a location for your
releases:
The advantage of this approach is that the releases may be located far away
from the source project.
Quality Control
When rules are promoted to the testing environment, several strategies can be
applied for validating the component/service quality.
Basic Validation
When a group of rules is a candidate for promotion to the testing area, basic
validation typically includes a compilation test. Compilation errors and
warnings can be reported to the development teams.
Conflict detection reports can also be executed to analyze the resulting rules
project. The first level of testing would be to report on the compilation errors
and conflict detection reports to the appropriate recipient.
During a typical promotion process, the rules must be tested. This includes first
and foremost the basic compilation validation. After the compilation test goes
through, regression tests should be performed to validate that the logic is
coherent with the business.
The promotion process then consists of migrating the rules to the next
repository. This process can be monitored manually. Most customers have
automated the process.
Blaze Advisor includes an Import and Export wizards. The wizards can extract
the portion of the repository that is of interest and import those rules inside
the target repository. This mechanism is used when the repositories have been
implemented with different storage mechanisms.
When both repositories have the same structure, the rules can be imported and
exported using low-level tools provided by the infrastructure. File-based
repositories can use simple file copying implemented via FTP, SSH, etc.
Database-based repositories must use a database import/export approach.
The technical team in charge of implementing this process must make decisions
on the most appropriate mechanism for the promotion process, whether or not
the history must be kept and migrated, and which files should be migrated.
When only business users are in charge of the rule maintenance application,
does it make sense to migrate the instance files only.
Scripts can be written and scheduled for automatic execution based on selected
triggering events.
It is prudent to couple the rule promotion process with a low level backup
mechanism. The target environment can be backed up prior to the import.
Once imported, the target environment can be tested. The process can either
notify the administrator or restore the old rules if the tests fail.
This diagram describes an example of promotion process. This simplification
assumes only two separate environments, while most customers have at least
three (Development, Testing, Production).
Execution Mode
Each ruleset, decision table, decision tree, decision graph, or score model can
be configured to be executed in one of three possible modes:
Rete or Optimized Inference
Sequential
Compiled Sequential
The standard execution mode is a Rete-based execution. Rete is an algorithm
that exhibits excellent scalability features when the number of rules, and in
particular the number of repeated evaluation fragments in the rule premises,
grows while the number of objects they are executed against does not explode.
This is an interpreted mode.
Note When using Rete or Optimized Inference execution mode, avoid the
excessive use of or statements in rule conditions. Doing so can significantly
degrade performance.
The compiled sequential mode replaces the Rete-based execution by the
execution of Java code that is emitted at project compilation time by
Blaze Advisor. In this mode, the rules are executed in native Java code
sequentially, one after the other, for all objects. When the objects being
manipulated are natively Java objects, this approach allows the Java virtual
machine to optimize the rules code through its various hotspot technologies,
thus allowing this approach to have significantly better performance
characteristics as the number of rules does not explode and the number of
objects does.
The key semantic difference between the two modes is the unavailability of
rule re-evaluation in the sequential modes. In sequential mode (compiled or
not), if a rule has been evaluated, it will not be re-evaluated in the same
session or invocation unless explicitly required by the code. It should be noted
that there are a number of cases of rulebases in which re-evaluation of rules is
used as a side effect to write evaluation loops, which can be done explicitly in
Blaze Advisor in both modes.
Deployment Manager
Rule services can be configured with the deployment manager facilities. A
deployment manager is a software component that either monitors the
repository or is notified programmatically of changes to the projects for rule
services, and is responsible for assembling new deployed versions of them,
making them available to the running rule services for them to reload them.
This allows, only through configuration, to obtain rule service deployments that
can automatically update themselves when the corresponding deployment
manager either detects or is notified of changes in the rule services, without
needing to bring any server or server-side component down or interrupt
transactions already being processed.
The same deployment manager can be used to provide a mechanism to
assemble deployments on the fly, based on configurations stored in the
repository. This could be used to solve the generation of rule services for
different data segments, or to support the management of rule services for ASP
operations.
The Deployment Manager is used in most projects, since updating rules on the
fly without bringing down the system is a key feature of rule engines.
Batch applications typically have different priorities; the primary one being
performance. Many batch applications must run in a limited time window. The
rules are typically not updated during the processing. The overhead of using a
deployment manager is not necessary in that case.
Again, note that the following depends of course of the ratio between these
two execution path spaces, but in general terms, the code generated by
Blaze Advisor may be significant in size and lend itself to significant
dynamic optimizations. In other words, the effects both in terms of initial
obtrusiveness and long term optimization of the dynamic optimization of
the Java HotSpot VMs will be most remarkable in this mode.
While it is impossible to come up with a general trade-off matrix describing the
various choices, the following table presents a typical case in which the logic
being executed resides mostly in the rules.
In terms of assessing the impact of the initial obtrusiveness, the following table
can be considered.
Note
The important information is in the comparison between the modes in
terms of orders of magnitude and not in the absolute numbers themselves.
This is just an example. The results will depend on the rules and the
implementation of the objects themselves.
The table uses an example of a compiled-out sequential mode
Blaze Advisor rules application with a few thousand rules and monitored
through 100,000 invocations.
The following links provide more details on the subject of dynamic optimization
in the various Java HotSpot VMs, as well as some details on the various
garbage collection technologies they use.
General Java HotSpot VM info:
http://www.oracle.com/technetwork/java/hotspotfaq-138619.html
Details on the options on the Java HotSpot VMs:
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-
140102.html
R
released projects
best practices 30
repositories
best practices 8
content organization practices 12
rule naming conventions 19
rules
best practices 18
best practices for performance 22
effective dating 25
formatting conventions 21
nested 22
processing and system dates 26
quality control 33
rulesets
naming conventions 20
S
Score Model Editor 29
score models
naming conventions 20
security management
best practices 9