You can only do local lookup when the rules are built either on Java or Java and XSD. The table below illustrates the lookup possibilities.
Ruleset Inputs |
Local Lookup |
---|---|
XSD |
Yes |
XSD + Java |
Yes |
Java |
Yes |
In above matrix, Java does not include the default Java aliases (Java classes) that are available with the Project. Ex: FunctionsUtil
Local Lookup
RuleEngineLocalHome.JNDI_NAME is the JNDI Name used for Local Lookup. Use the following code for local lookup of rules engine.
InitialContext context = getInitialContext(); RuleEngineLocalHome home = (RuleEngineLocalHome) context.lookup(RuleEngineLocalHome.JNDI_NAME); RuleEngineLocal local = home.create(); RuleEngine engine = (RuleEngine) local;