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. This class is supported by both the decision engine and the classic rule engine.
The IlrRuleEngineEventPlugin class fulfills the same purpose but is only kept for compatibility with earlier versions. You can use it only with the classic rule engine.
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.setTraceEnabled 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()
- Business names of rules and tasks:
- Initialize input parameters
- IlrSessionRequest.setInputParameter and 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 methodTip:
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