Show TOC

Procedure documentationLooking Up the Rules Engine Locate this document in the navigation structure

 

You can look up the Rules Engine either locally or remotely or both depending on whether your rules are built on XSD or Java or both. You can do the remote lookup only when your rules are built on XSD. You can only do local lookup when the rules are built either on Java or Java + XSD. The table below illustrates the lookup possibilities.

Ruleset Inputs

Remote Lookup

Local Lookup

XSD

Yes

Yes

XSD + Java

No

Yes

Java

No

Yes

Note Note

In above matrix, Java does not include the default Java aliases (Java classes) that are available with the Project. Ex: FunctionsUtil

End of the note.

Procedure

Remote Lookup

RuleEngineHome.JNDI_NAME is the JNDI Name used for Remote Lookup. Use the following code for remote lookup of rules engine.

Syntax Syntax

  1. InitialContext context = getInitialContext();
  2. Object obj = context.lookup(RuleEngineHome.JNDI_NAME);
  3. RuleEngineHome home = (RuleEngineHome) PortableRemoteObject.narrow(obj,
    				RuleEngineHome.class);
    
  4. RuleEngineRemote remote = home.create();
  5. RuleEngine engine = (RuleEngine) remote;
End of the code.
Local Lookup

RuleEngineLocalHome.JNDI_NAME is the JNDI Name used for Local Lookup. Use the following code for local lookup of rules engine.

Syntax Syntax

  1. InitialContext context = getInitialContext();
  2. RuleEngineLocalHome home = (RuleEngineLocalHome) context.lookup(RuleEngineLocalHome.JNDI_NAME);
    
  3. RuleEngineLocal local = home.create();
  4. RuleEngine engine = (RuleEngine) local;
    
End of the code.