ILOG JRules User Guide > Running and Debugging > Tasks > Troubleshooting Execution > Debug Notifications

Debugging of the sequential mode should be explicitly turned on so that the tools (IlrTool) connected to the rule engine can receive notification events at runtime. Once debugging is activated, the sequential mode compiler adds extra notification instructions to the generated bytecode.

Note
The generated bytecode becomes bigger than the ordinary sequential mode bytecode. However, since notifications are added in the action parts of the rules and not in the condition parts, the bytecode is only a little slower than the ordinary sequential mode bytecode.

You can activate the generation of the debugging notifications for the sequential mode:

Debugging Setup in IRL

You can activate debugging in IRL at task or at ruleset level, or for a particular task by setting the debug property.

To activate debugging at task level:

ruletask T {
       property ilog.rules.engine.sequential.debug = true;
       algorithm = sequential;
       ...
}

To activate debugging in IRL at ruleset level:

ruleset R {
       property ilog.rules.engine.sequential.debug = true;
}
 
ruletask T1 {
       algorithm = sequential;
       ...
}
 
ruletask T2 {
       algorithm = sequential;
       ...
}

In this case, debugging notifications will be added to the generated bytecode to both task T1 and task T2.

You can also activate debugging of the sequential mode for a particular task using a special generic notation:

ruleset R {
       property ilog.rules.engine.sequential.debug.T1 = true;
}
 
ruletask T1 {
       algorithm = sequential;
       ...
}
 
ruletask T2 {
       algorithm = sequential;
       ...
}

In this case, debugging notifications will be generated only for T1 and not for T2.

Debug Setup by API

You can set the ruleset property using the API. In this case, you need to set the property prior to any parsing. This enables the debugging activation property to be taken into account even in the static case where the sequential ruletask is defined by an explicit list of rule names.

package myPackage;
 
import ilog.rules.engine.IlrRuleset;
import ilog.rules.factory.IlrPropertyList;
 
public class MyDebugSetter {
 
       public static void setDebug(IlrRuleset rs,
                                   boolean debug)
       {
          IlrPropertyList props = rs.getProperties();
          Boolean         wrapper = (debug ? Boolean.TRUE
                                              : Boolean.FALSE);
       
          // Pass a Boolean wrapper, not a String !
          props.put("ilog.rules.engine.sequential.debug",wrapper);
       }
}

Debug Setup in Java

You can activate debugging for the sequential mode by setting a Java property, typically when launching the application.

java -Dilog.rules.engine.sequential.debug=true myApp

Notice that the name of the variable must be fully qualified with "ilog.rules.engine" so as not to conflict with other Java variables.

Related Concepts

Related Concepts

Related Tasks

Choosing an Execution Mode

Related Samples and Tutorials

Rule-Based Programming