Execution class mapping
You can map a business class to an execution class. By default, the elements of the business class are mapped to the elements of the execution class.
To map a business class to an execution class, you must specify the name of the execution class in the BOM Editor. For example, you can map the business class RichCustomer to the execution class Customer.
You define the execution class in the Execution class name field of the BOM to XOM Mapping section of the BOM Editor.
When you run the rules, the execution class is used instead of the business class. If members of the business class are not explicitly mapped, the BOM-to-XOM mechanism assumes that they are the same as the members of the execution class. The following table describes how the BOM-to-XOM mechanism uses these members:
Member of business class BusinessClass | Case | Mapping to execution member of class ExecutionClass |
---|---|---|
Constructor BusinessClass(MyBizClassB, MyBizClassC) | Call by new | Constructor ExecutionClass(MyClassB, MyClassC) |
Attribute MyBizClassA attr | Assignment | Attribute attr (not read-only) |
Access | Attribute attr (not write-only) | |
Method MyBizClassA myBizMethod(MyBizClassB, MyBizClassC) | Invocation | Method MyClassA myMethod(MyClassB, MyClassC) |
BusinessClass is used | Use of operator InstanceOf, or cast, or classification in conditions | ExecutionClass |
For the best results, follow these rules for mapping:
- When the business class is a utility class, map it to void.
- When the business class is an enumerated class, do not provide a tester.
- When a tester is provided, it is used by priority. Make sure it filters true for the right instances. For example, mapping a business class to java.lang.Object with a tester that always returns true makes the system believe that all the objects are of this business class.