Rule Builder > Debugging and Profiling > Testing the Execution of a Ruleset > Executing a Ruleset in the Rule Builder

To execute a ruleset:

If the ruleset does not contain any errors, execution starts and the Rule Builder displays the first rule to execute. A yellow arrow marks the first action that is evaluated (also highlighted in blue). In the Engine Explorer, a yellow arrow points to the rule that is currently executing, as shown in Figure 16.6.

images/enginesExplorerExecution.gif

Figure 16.6    Engine Explorer During Execution

A new entry is added to the Engine Explorer when you execute a ruleset in the Rule Builder or launch a remote application with the appropriate property.

The Engine Explorer lists the engines that have been connected to the Rule Builder. You can launch several applications at the same time, but only one will be active at a time in the Rule Builder. The engine you run for the active application is called the current engine. The name of the current engine appears in bold in the Engine Explorer.

All the debugging and profiling panels are attached to the current engine. If you click a different engine, it will become the current engine, and all the debugging and profiling panels will be reset and attach to the new current engine.

To view the rules associated with an engine:

When you execute a ruleset, the rules that you execute are displayed in the Engine Explorer. Two instances of a rule can exist simultaneously in the Rule Builder: one editable business rule available in the Project Explorer, and one execution rule available in the Engine Explorer.

The rules displayed in the Project Explorer and in the Engine Explorer are not really the same. Rules in the Project Explorer are rules from the repository, and rules in the Engine Explorer are execution rules from a running engine. You may not have the same rules in both panels. For example, if you connect the Rule Builder as a debugger for a running engine, the engine will send its rules, which will be displayed in the Engine Explorer. They will not be displayed in the Project Explorer.

To change the execution rules from a running engine into a package of rules that will be displayed in the Project Explorer:

A new package and a new template library are added to your current project.

If you right-click an engine in the Engine Explorer, a shortcut menu appears to let you choose one of the items described in Table 16.4.

Table 16.4   Description of the Items in the Engine Shortcut Menu
Shortcut Menu Item 
Description 
Execute  Execute the IlrContext. This item is available when the engine is in the controlled state only. 
Fire Rule  Fires the rule instance with the highest priority that is contained in the agenda of the engine. This item is available when the engine is in the controlled state only. 
Execute ilrmain  Executes the function ilrmain if it exists, otherwise displays the message "The current engine has no `ilrmain' function". 
Reset  Calls the reset method of the engine. By default, this method retracts all the objects from the working memory and applies the functions. This method can be redefined, see IlrContext.reset() in the Java API Reference Manual for more details. This item is available when the engine is in the controlled state only. 
Create Project Package  Creates a new package, and then adds the rules, functions, and functions of the engine to this package. 
Release  Releases control of the engine. The execution exits from the method IlrContext.delegateControl. This item is available when the engine is in the controlled state only. 
Remove  Disconnects the engine from the Rule Builder and removes the engine from the Engine Explorer. 
Info  Opens a panel providing information about the current engine. 

To activate or deactivate a rule:

A deactivated rule will never be sent to the agenda and therefore will never be fired, whereas an active rule will be sent to the agenda and fired if its conditions are met.

See Also

Connecting a Remote Engine


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