OpenRules Debuggers

OpenRules Decision Manager provides two Decision Model Debuggers:

While the graphical debugger is the most user friendly debugger, it is currently available only under Windows and Linux. The Command Line Debugger is available under Windows, Mac, and Linux.

To activate the Command Line Debugger you need to add the property

debug=On

to your “project.properties” file. When you run “test.bat” (or “test” shell under Mac/Linux) your decision model will be executed in the debug mode. The execution will stop after executing the very first selected rule and you will be able to 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 by entering * or vars.

Let’s consider how we can debug our popular decision model “Vacation Days” described here. Add the property “debug=On” in your “project.properties” file and double-click on “test.bat”. You will see a protocol like this one 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 “test.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 under Win, Mac, or Linux.

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 )

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.