Rule overriding

Rule overriding is the last selection mechanism after ordering and priorities. Overridden rules are not selected for execution. You can combine rule overriding with the hierarchical property.

Rule overriding is the final stage of rule selection. After all other selection mechanisms, you can specify that certain rules override other rules. Overridden rules are filtered out and not selected for execution.

A rule can override one or more other rules if these rules are selected in the same rule task at run time. You can set an entire decision table to override another decision table or tree.

Combine rule overriding with the hierarchical property

You can also combine rule overriding with the hierarchical property, enabling specific rules to override more general rules. You specify overriding in Rule Designer by setting the overriddenRules rule property. Using the overriddenRules property, you can select which rule artifacts are to be overridden and specify the overriding relationship between a rule and other rules.

The following diagram shows how rule overriding works in a hierarchical rule structure.

Diagram of rule overriding in a hierarchical rule structure

Selection operates as follows:

  1. The first selection is based on the effective date property. This drops rule r2 from the selection, leaving r1, r3, r4, r5, and r6.

  2. At run time, only the first package is selected (for example, p1 has been added to the rule task, but p2 has not). As a result, r6 is filtered out of the selection.

  3. Runtime rule selection is set to the location of the rule is over ‘Florida’, so only USA and Florida rules will be considered for execution (see the Geography hierarchy tree in the diagram). As a result, r5 is filtered out of the selection.

  4. Finally, r3 overrides r1. Therefore, only the conditions of r3 and r4 are left to be evaluated. The rules whose actions match the required conditions are executed.