Rule Builder > Debugging and Profiling > Testing the Business Rules > Debugger

The Debugger panels are useful when you start testing and debugging the execution of your rules. The Debugger monitors business rule execution by, for example, checking the ruleset, connecting to a rule engine, sending the ruleset to the engine, resetting the engine, and firing all the rules.

To run the Debugger, start the execution (see Creating an Engine in the Rule Builder and Executing a Ruleset in the Rule Builder) and choose one item from the Debugger Panels submenu in the Views menu. Eight panels are available: Bindings\Parameters, Execution Object Model, Working Memory, Agenda, Trace, Output, Console, and Breakpoints. The panels are displayed at the bottom of the Rule Builder window. With the Debugger, the process of business rule execution can be controlled by:

The Working Memory panel displays the list of all the objects in working memory. Double-clicking the name of an object expands and displays the value and type of the object's various fields. This allows direct inspection of the objects that it uses, which is important in determining whether a rule is behaving correctly or not. For example, in the Working Memory panel, an instance of the ShoppingCart object is shown with a content valued at $119.5 as shown in Figure 16.10. Rules currently in the agenda that use this value can easily be checked if there is some suspicion regarding their behavior. This enables you to dynamically inspect objects as they affect rules.

The Agenda panel provides the current state of the agenda, displaying any business rule instances scheduled for execution. Double-clicking the rule name instance expands the business rule, displaying its priority in the agenda and the objects used by it. This, in conjunction with the Working Memory panel, provides a powerful way to quickly debug an application.

The Bindings\Parameters panel displays the names of variables currently bound to a business rule and parameters currently visible in the engine. That is, if the ShoppingCart object is bound to a variable called ?shoppingCart in one of the rules, the Bindings\Parameters panel would show this relationship.

The Execution Object Model panel displays the object model that the rule engine is currently using. This could contain application objects defined by Java classes or XML data.

The Trace panel gives access to the history of all the events occurring in the rule engine. Right-clicking the panel opens a shortcut menu, which allows you to pick the types of notification to trace. Objects, rules, and the agenda may all be traced simultaneously or selected individually for tracing. This helps reduce the amount of data that must be filtered through by the developer during a debugging session.

The Output panel displays messages that have been sent to the output stream associated with the engine.

The Console panel provides a prompt that you can use to manually enter commands.

The Breakpoints panel allows you to add and remove breakpoints to stop the execution of rules at a point defined by you.

Debugging an application that implements a rule engine is even easier with the visualization of rule executions. Such a graphical feature is available in ILOG JRules through the Profiler.

An example of the Debugger panels is shown in Figure 16.10.

images/wmemory_debug.gif

Figure 16.10    Debugger Panels

See Also

Debugging | Debugger Toolbar | Profiling | Inspecting the Working Memory | Inspecting the Agenda | Inspecting Bindings and Parameters | Inspecting the Execution Object Model | Inspecting the Trace | Viewing the Output | Using the Console | Setting Breakpoints


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT