| ILOG JRules User Guide > Creating Rule Projects > Tasks > Defining How Business Elements Map to the XOM > Accessing Rule Instances from IRL Mapping Code |
Accessing Rule Instances from IRL Mapping Code |
PREVIOUS NEXT |
You can access the current rule instance by using the predefined variable instance (you can also write it ?instance). This predefined variable can be used in any of the execution modes (Rete, Sequential, or Fastpath).
In IRL mapping code, the instance variable may be null. It is not null when the member is used in a rule action.
To access a rule instance:
instance to access the rule instance.
In this example, IRL mapping is used to add a trace:
if (instance != null)
out.println("IRL mapping of method M being called
by rule "+instance.ruleName);
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |