Open Your Business Rules!
Rules-based
Operational Decision Services
OpenRules Classic: What-If Analyzer for Business Decision Modeling
Provides a Web Interface for Real-Time What-If Analysis of Decision Models
What-If Analyzer is a stand-alone web application built
on top of OpenRules®
Rule Solver. Its main purpose is to support what-if
analysis of decision models built in accordance with the
DMN standard.
What-if analysis is the process of changing the business
rules that represent business logic to see how those
changes will affect the outcome of the decision model.
What-If Analyzer may download a
DMN-based decision model, and show it graphically
presenting the current state of all decision variables
and all business rules. For example, the decision model
“Loan Pre-Qualification” described
here will be presented by the What-If Analyzer as on
the picture below:
A user may activate/deactivate
different rules and immediately see how these actions
change the domains of affected decision variables. A
user may find a feasible solution that satisfies all
currently active rules, find and navigate through
multiple solutions, and even find an optimal solutions
based on various business objectives.
Demo Using a Simple Arithmetic Decision Model
To see various capabilities of
the What-If Analyzer, let’s consider a small decision
model that deals with only 4 decision variables and
various arithmetic constraints defined on them.
Initially all 4 variables were defined in the following
Excel-based glossary:
When we open this decision model
inside the What-If Analyzer, I will show the current
domains of all variables and all rules with their
activity statuses:
When a user activates the rule “Z >
5” by checking the proper flag in the table “Business
Rules”, the analyzer immediately modifies the domain of
all affected variables in the table “Decision Variables”
on the left. If we deactivate this rule and try to
activate the rule “Z < 5”, the analyzer immediately will
point us to the conflict:
When a user pushes the button “Solution”,
the analyzer will find and show the first feasible
solution. A user may push buttons “Next” and “Prev”
to find and navigate through the various solutions that
satisfy all currently active rules:
If the decision model specifies an
objective like the one above (Objective = X*Y-Z), the
analyzer may even find an optimal solution that
minimizes or maximizes this objective:
A user may "Deactivate All Rules" and start activating various rules one-by-one and analyzing their contribution to the removal of certain values from the domains of decision variables. Actually a user of What-If Analyzer has an ability to emulate various rules execution modes usually available to only rule engine developers (such as forward-chaining and backward-chaining).
Traditional decision models created
in the DMN fashion are static meaning all business rules
that define business logic are already defined and
activated. What-If Analyzer allows converting them into
highly dynamic models by giving a user an ability to
activate/deactivate/replace some rules and right away to
see all possible decision outcomes.
Doing what-if analysis, decision
modelers have an ability to find and resolve conflicts
among business rules defined inside the same or
different decision tables. Comparing outcome of the
decision model for various combinations of business
rules, allows business analyst to treat different
instances of the same business problems in the best
possible way by finding the “champion” combination of
rules for frequently changing business environment.
Usually decision models specify only
one solution called decision outcome. Deactivation some
rules, allows a user to relax their decision model, and
ask an Analyzer to show multiple feasible solutions
If a user specifies an optimization objective, s/he may ask the What-If Analyzer to find an optimal solution that minimizes or maximize this objective.
Availability on Cloud and on Premises
You may try What-If Analyzer with a
predefined set of decision model online without any
installation. The currently available set of decision
models that can be analyzed online is described in the
following Excel table:
To run What-If Analyzer from our remote server, you only
need to know the proper URL that you may request by
sending an email to
support@openrules.com. Keep in mind, that What-If
Analyzer may take a lot of computation resources from
the server, so we are trying not to overload our server
with too many concurrent requests.
You always may get your local version
of the What-If Analyzer as a part of the complete
OpenRules release. It is available as a separate project
called “WhatIfAnalyzer” within the workspace “openrules.solver”.
You may deploy this project on your own Apache Tomcat
server by simply running “deploy.bat”. Make sure that
you already have "openrules.forms.lib"
deployed on the same server - otherwise click-on
openrules.forms.lib/deploy.bat.
Then you may start a web application “What-If Analyzer”
with you own browser using “runLocal.html”. Note that
the project “WhatIfAnalyzer” is self-sufficient and
contains all necessary jar-files and standard Excel
templates.
What-If Analyzer is a web application that utilizes the porwer of OpenRules Rule Solver and underlying JSR-331 compliant constraint engines. When the analyzer downloads a new decision model it internally generates the proper constraint satisfaction problem (CSP).
All displayed decision variables come from the decision glossary or defined by Rule Solver variable definition constructs (such as ActionAddActivity). All displayed business rules have been collected from all decisions, sub-decisions, and decision tables and internally are represented as the CSP constraints. The activation of a rules means to proper constraint propagation process that may to exclude some values from the domains of affected (directly or indirectly) decision variables. When a new rule (constraint) makes a domain of at least one variable empty, it means the system found a conflict with previously activated rules (constraints). Finding a feasible solution, multiple solutions (with a limit for their maximal number) or an optimal solution are all natural tasks for the underlying constraint engine (contrary to traditional rule engine including those that are RETE-based).
Changing the Analyzer Settings
You may change the default setting of the What-If Analyzer by clicking on the button "Setting". It will display the following properties associated with your analysis process:
You may change these setting and click on "Main View". If you increase the "Maximal Number Of Solutions" it may see that clicking on the button "Next" may produce more solutions. The optimal solution may also be better optimized but you have to be careful here not to put the Analyzer in the "forever" loop analyzing an enormous number of all possible solutions. The "Vertical" layout (contrary to the "Horizontal" one) allows you to display the table "Business Rules" not on the right of the table "Decision Variables" but under it. By setting "Show Decision Tables" to "No" will make your table "Business Rules" narrower but you would not see to which decision tables different rules belong.
You may change the default settings and make them decision model specific. To do this you need to add to your decision model (usually in the file Decision.xls) the following two tables:
Adding Your
Own Decision Models
You may add your own decision model to the local version
of the What-If Analyzer. Before doing that you need to
understand how the available decision models are
organized. Let’s look at the Decision Model
located in the folder “war/DecisionModels/Loan
Origination/” of the downloaded project “openrules.solver/WhatIfAnalyzer”.
It is a slightly modified version of the decision model
“DecisionLoan” from the standard workspace “openrules.decisions”.
We made a few changes in the “DecisionLoan” to satisfy
the current What-If Analyzer:
-
The main decision in the file “Decision.xls” has a predefined name “Main”
-
The Environment table in the file “Decision.xls” refers to the DecisionTemplates.xls defined within this project and there are two additional “import.java” statements:
-
The worksheet “GUI Properties” is optional and defines model-specific properties for the What-If Analyser (like “Maximal Number Of Solutions”) – they always can be changed online when you click on the button "Settings" in the running Analyzer.
-
We added an optional first row “OnOff” to the decision table “DetermineDebtResearchResult” to demonstrate how to use rules activation and deactivation. In particular, we added another rule at the end of the table. This rule is a possible alternative to the previous rule and its active status is “Off”.
-
The analyzer allows to user formulas only with special conditions and actions ConditionXoperY or ActionXoperYcompareZ from DecisionTableSolveTemplates.xls instead of regular conditions and actions. So, we replaced the decision table
with
Here an intermediate variable
“Doubled Total Debt” was added to the Glossary and was
calculated along with other intermediate variables in
the standard formulas:
No other changes were required.
Now let’s say your decision model has a name “MyDecisionModel”.
We assume that you already were able to run this
decision model within standard OpenRules workspace “openrules.decisions”.
Then you need to make the following changes in the
project “openrules.solver/WhatIfAnalyzer”:
-
Add a folder “MyDecisionModel” to the war/DecisionModel/
-
Move all your Excel files to this folder and make necessary changes similar to those we described above for the “Loan Origination” decision model.
-
Add a new row to the table “decisionModels” in the file “was/GUI/Main.xls”. It should include the following columns:
-
ID: MyDecisionModel
-
Decision URL: MyDecsionModel/Decision.xls
-
Glossary URL: MyDecsionModel/Glossary.xls
-
Rule URL: MyDecsionModel/Rules.xls
-
Description: plain English description of your model
After you redeploy the analyzer, it should show your
model or diagnose possible errors in its organization.
Analyzing DMN-Compliant Decision Model
What-If Analyzer has unique features that previously were out of reach for traditional Business Rules and Decision Management systems. Currently What-If Analyzer works with decision models created within OpenRules® system. However, it was designed in a such way that will allow the same tool to be applied for analysis of decision models created using other decision management products. To work with a decision model created using the product "XYZ" we need to expand What-If Analyzer with another implementation of the "decision model download" module specific for the product "XYZ".
We especially hopeful that a new version 1.1 of the DMN Standard will support practical interoperability between different decision modeling tools. OpenRules plans to implement a new XML import/export standard format for decision models. In particular, we expect it will allow What-If Analyzer to support different DMN-compliant decision models.
Being in its first official release, What-If Analyzer naturally has several implementation restrictions in its GUI and deployment mechanisms. The current version of What-If Analyzer also inherited the implementation restrictions of the Rule Solver™. In particular, it limits the decision models only to integer and string decision variables. There are also limits to the use of the standard OpenRules® formulas as described in the above example. We plan to remove many restrictions and to add new features based on the customer feedback. OpenRules, Inc. provides professional services to assist customers in the development, analysis, and optimization of their decision models. We may help you to customize the What-If Analyzer for you particular needs by modifying its graphical interface and providing an integration with your specific decision modeling and execution environments. If you are interested, please contact us at consulting@openrules.com.