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. Conversely, the BOM-to-XOM mapping also helps to deduce the business class from a particular class instance, such as for testing and simulation.

To map a business class to an execution class, you must specify the name of the execution class in the BOM Editor.

You define the execution class in the Execution name field of the BOM to XOM Mapping section of the BOM Editor. For complex mapping, you can use a tester to test the instances of the execution class by using rule language mapping.

When you run the rules, the execution class is used instead of the business class whenever needed.

For best results, apply the following rules to the 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 you do provide a tester, write it carefully so that it filters out all non-matching class instances, by returning false.

For example, you can map the business class RichCustomer to an execution class Customer: In the BOM Editor, in the BOM to XOM Mapping section, type a rule language statement that returns a Boolean value in the Tester field. Use this to represent the current object. For example:

return this.money > 100000;

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:

Table 1. Implicit mapping to members of an execution class
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