Build, Test, Debug

The downloaded workspace “” includes various examples of decision models that you can build, test, debug, and deploy. See examples of decision models here. They provide good prototypes for your own  operational decision models.

Building Decision Model

After you complete the design of your decision model and define its parameters in the file “settings.bat“, you need to build it by a simple double-click on the standard file “build.bat“. It will automatically transform all Excel tables to Java packages placed in the folder “generated” (or as defined in the setting.bat). Nobody ever should modify the generated files. You even don’t have to look at them – they are simply will be used by the Decision Manager to deploy and execute your model.

OpenRules DM keeps track to the original Excel tables, and produces all messages and explanations in the business terms used in Excel.

Testing Decision Model

When you design your decision  model, you usually also create a set of test-cases in Excel (see Test.xls in samples). You can execute your decision models against these test-cases by a simple double-click on “run.bat“. Decision Manager will you execute your model and will produce a user-friendly protocol with the execution results.

Along with the execution protocol, Decision Manager also produces the explanation reports in the folder “report” using a friendly HTML format.  It shows all executed rules and values of the involved decision variables in the moment of execution.

Debugging Decision Model

You may add the setting set DEBUG=On to your “settings.bat” file. Then when you click on on “run.bat”, your decision model will be executed in the debug mode. It means it will automatically stop at the beginning of execution and will display on the console “>” asking you to enter a debug command. If you just click <Enter> it will execute the next rule, will show the value of the involved variables and stop again. This way by just clicking <Enter> you may debug your model rule-by-rule. At any moment, you may also enter the following commands:

See example of decision model debugging in this post.

Note. Some decision models (e.g. HelloJava) use data instances created not in Excel but using the existing Java classes. In such cases, you can build the model using the provided batch file “buildJava.bat” and execute it using “runJava.bat”.