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:

Important: For rule language mapping, when a rule project targets the decision engine, write the mapping in ARL, which is stored in a .b2xa file. When the project targets the classic rule engine, write in IRL, which is stored in a .b2x file. When you switch a project from the classic rule engine to the decision engine for the first time, the .b2x file is migrated to a .b2xa file.

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:

  1. Explicit mapping in rule language.
  2. Explicit mapping with extender class.
  3. 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.