Debugging Business Decision Models

OpenRules Decision Manager 8.1.0 includes a special Rule Debugger that allows business users to debug their decision models while they are being executed. The debugger stops execution after executing the first selected rule and a user can analyze the current content of all decision variables to understand why certain rules were executed or skipped. After pushing “Enter” the next selected rule will be executed. A user may continue to push “Enter” until all rules are executed.

Alternatively, a user may enter

>table <name>
>go

and all rules will be executed until debugger reaches the table “name”. A user may analyze all variables before and after a table/rule being executed.

Let’s consider how we can debug our popular decision model “Vacation Days” described here. Usually you click on the batch file “run.bat” to build and run the decision model. To run the model in the debug mode, you should double-click on “debug.bat” or add the property “debug=On” in your “project.properties” file. You will see this protocol at your console:

The debugger will wait for you typing something after “>”. If you just push “Enter” or type “next“, the next rule will be executed and will show:

  • the rule and table names
  • the rule text
  • all variables involved in the rule and their values after the rules execution.

Here is an example:

If you enter “*” or “vars” you will see the values of ALL of your decision variables as below:

You may continue to push “Enter”, to see and analyze other executed rules. You may enter “>go” or “>end” to run all rules to the very end.

To interrupt the execution process at any moment you may enter the command “>q” or “>quit“.

Let’s start again by double-click on “debug.bat”. This time we want to debug only the table “CalculateVacationDays”. To do this, we may enter the command “>table CalculateVacationDays” and then “>go“. The debugger will show all executed rules (without stopping at them) and will stop only before evaluating the table “CalculateVacationDays”. You may display all variables at this moment by typing “>vars“. Here is what you will see:

As you can see, several rules were already executed and the variables “Eligible for Extra 5 Days”, “Eligible for Extra 3 Days”, and “Eligible for Extra 2 Days” received values true, false, and false correspondingly. It already can prompt you to how the rules inside this multi-hit decision table “CalculateVacationDays” will be evaluated. However, this is a simple case as our decision table in Excel looks as follows:

Let’s assume that you want to stop before some rule inside this table being evaluated, for example before the second rule described in cells “B6:F6”. You can enter the command “>rule 2” or “>rule B6:F6” or even simply “>rule B6“. After you enter “>go“, you will see:

Now you may continue to push “Enter” and see all actually executed rules. Here is the final view for this test case:

Then you may continue to debug the second test case or just enter “>go” or “>end” to finish debugging.

At any moment you may enter the command “>help” you will see a summary of all available commands:

Thus, using these commands you may successfully debug you business decision model. The new Rule Debugger is currently available with the release 8.1.0 of OpenRules Decision Manager.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.