ILOG JRules User Guide > Creating Rule Projects > Concepts > BOM and XOM > The BOM to XOM Mapping Mechanism > Extender Mapping

Extender mapping is useful if you prefer to use Java rather than IRL. You define an extender class name for a class in the Extender class field of the BOM to XOM Mapping section of the BOM Editor, then the BOM to XOM mapping mechanism looks up for extender elements with the same name as your business elements in the extender class. Therefore, when you create the extender class, make sure you create elements that can be found from the business element name.

This table assumes that an execution class name ExecutionClass has been given to the business class BusinessClass.

Table 4 Extender Mapping Possibilities
Member of Business Class BusinessClass 
Case 
Scope 
Extender Member of Class ExtenderClass 
Constructor BusinessClass(MyBizClassB, MyBizClassC) 
Call by new 
static ExecutionClass create(MyClassB, MyClassC) 
Attribute MyBizClassA attr 
Assignment 
static 
static MyClassA attr 
OR static void setAttr(MyClassA) 
instance 
static void setAttr(ExecutionClass, MyClassA) 
Access 
static 
static MyClassA 
OR static MyClassA getAttr() 
instance 
static MyClassA getAttr(ExecutionClass) 
Method MyBizClassA myBizMethod(MyBizClassB, MyBizClassC) 
Invocation 
static 
static MyClassA myMethod(MyClassB, MyClassC) 
instance 
static MyClassA myMethod(ExecutionClass, MyClassB, MyClassC) 
InstanceOf operator (Tester) 
Use of operator classification in conditions. 
static boolean tester(ExecutionClass) 

Example

Here is an example of an extender class for a BOM class called EventDispatcher.

public class DispatcherExtender {
  /**
   * This extender method implements
   * EventDispatcher.exception(FinancialEvent, String) 
   */
  public static void exception(GenericObject dispatcher, 
                               GenericObject event, 
                               String message) {
    System.out.println("###> Processing Exception : event " 
                                         + event + message + "<###");
  }
  
  /**
   * This extender method implements
   * EventDispatcher.send(FinancialEvent, String) 
   */
  public static void send(GenericObject dispatcher, 
                          GenericObject event, 
                          String target) {
    System.out.println("===> Sending " + event + " to " + target + " <===");
  }
}

Related Concepts

The BOM to XOM Mapping Mechanism
Execution Class
IRL Mapping

Related Tasks

Defining How Business Elements Map to the XOM

Related Reference

BOM Editor

Related Samples and Tutorials

Tutorial: Defining a Vocabulary
How to Write Rules Independently of the Execution Model