You can get information on the tasks executed and the rules fired, and information on the working memory, including which version of the ruleset was executed.
To get information on the tasks executed and the rules fired:
-
Set the engine trace properties for the deployed ruleset to
true:
ruleset.sequential.trace.enabled=true
ruleset.trace.enabled=true
You set these properties at RuleApp level, in the
properties.txt file. By default, all the information is retrieved except for the working memory.
To get information on the working memory:
desc.addFilterProperty(IlrExecutionTraceFilterConstants.INFO_WORKING_MEMORY, "true");
If you want to obtain the exact version of the executed ruleset, you can request the canonical ruleset path, using the following code:
IlrSessionResponse.getExecutionProperties().getCanonicalRulesetPath()
When the ruleset execution has completed, the execution trace is stored in an object and you can inspect the traces.
You can also get a trace when a ruleset is executed, using one of the following:
-
J2SE Plain Old Java Object (POJO) rule session
-
J2EE/POJO rule session
-
J2EE/EJB stateless or stateful rule sessions
To invoke the execution trace in J2SE:
IlrSessionRequest request = new IlrSessionRequest(rulesetName);
IlrSessionExecutionSettings execSettings = request.getExecutionSettings();
IlrSessionDescriptor desc = request.getSessionDescriptor();
ilog.rules.bres.session.IlrSessionFilter filter = ...;
IlrSessionParameters parameters = execSettings.getInputParameters();
parameters.setParameter("borrower", borrower);
parameters.setParameter("loan", loan);
IlrSessionResponse response;
IlrRuleSessionProvider provider = new IlrRuleSessionProviderFactory.
Builder(IlrRuleSessionProviderFactory.
J2SE_RULESESSION_PROVIDER).
setLogger(loggerPrinter).build();
IlrStatelessRuleSession session = provider.
createStatelessRuleSession();
response = session.executeRules(request);
To invoke the execution trace in J2EE/POJO:
IlrRuleSessionProvider provider = new IlrRuleSessionProviderFactory.
Builder(IlrRuleSessionProviderFactory.
SIMPLE_RULESESSION_PROVIDER).build();
To invoke the execution trace in J2EE/EJB:
IlrRuleSessionProvider provider = new IlrRuleSessionProviderFactory.
Builder(IlrRuleSessionProviderFactory.
MANAGED_RULESESSION_PROVIDER).build();
Related Concepts
Related Tasks
Related Reference