Execution trace API

Execution traces record which rules and tasks are executed. Specific classes and methods are available for you to trace ruleset execution on the server side and on the client side.

Use the following ilog.rules.res.session classes and methods to define what you want the execution trace to show.

On the server side

To trace execution on the server side, use the EventPlugin class.

On the client side

On the client side, the following classes and methods are available.

Access the execution trace directly
IlrSessionResponse interface.
Get a response with an execution trace
IlrSessionRequest.IlrSessionRequest#setTraceEnabled(true) method
Access the business names
Call the following methods of theIlrBusinessExecutionTrace class:
  • Business names of rules and tasks:
    IlrBusinessExecutionTrace businessTrace = new IlrBusinessExecutionTrace(response.getRulesetExecutionTrace());
  • Business name of an executed rule:
    businessTrace.getRuleFiredBusinessNames()
Initialize input parameters
IlrSessionRequest.setInputParameter and IlrSessionRequest.setInputParameters methods
Access the execution events as a tree of the executed tasks, and of the executed rules in each task, in their execution order
IlrSessionRequest.getTraceFilter().setInfoExecutionEvents method
Tip:

By default, the objects that are bound to the rules are serialized in the trace. Such binding is possible only if the XOM objects are all serializable. Otherwise, also use the IlrSessionRequest.getTraceFilter().setInfoBoundObjectByRule method to filter out from the execution trace the information about the objects that are bound to the executed rules.

Filter the execution data
IlrTraceFilter interface
Get the exact version of the executed ruleset
IlrSessionResponse.getCanonicalRulesetPath method
Get the state of the working memory
IlrTraceFilter.setInfoWorkingMemory method