Rule language and extender mapping
Rule artifacts that are created from the BOM must be mapped to the XOM to run at run time. You can use the default mapping, or mappings based on rule language functions or Java™ extender classes.
The BOM-to-XOM mapping mechanism can translate BOM-based rule artifacts into XOM-based rule artifacts at run time. The mechanism provides a default mapping, and supports two kinds of explicit mapping:
Rule language mapping: You associate a business element with rule language code that is based on the XOM. You can call functions, ruleset parameters and variables, and rule instances.
Extender mapping: In a Java extender class, you create static elements that have the same name as business class members. You can use extender mapping only on a Java XOM. If you have a dynamic XOM, use rule language mapping.
The BOM-to-XOM mapping is defined in a BOM-to-XOM mapping XML schema.
At run time, the rule engine uses the following order to find the right mapping:
- Explicit mapping in rule language.
- Explicit mapping with extender class.
- Implicit mapping, by default when nothing is specified.
If the rule engine does not find a mapping by default, it gives you an error.
Unexpected results for overriding methods
The BAL object operator is one of does not use BOM-to-XOM redefined equals. If you apply BOM-to-XOM mapping to a method that overrides another method, you might receive an unexpected result. If there is a direct call to the overriding method, the BOM-to-XOM mapping is applied. However, in an indirect call, such as a call to the method in a superclass or interface, the BOM-to-XOM mapping is not applied to the overriding method.
For example, if you override the method Object.equals(Object) in a BOM class and provide a BOM-to-XOM implementation, the BOM-to-XOM implementation is called when an instance of such a class is inside a collection, such as when HashSet.add(Object) or ArrayList.contains(Object) is called.