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. Rule overriding occurs at the individual rule, decision table, or decision tree level. You can set an entire business decision table to override another decision table or tree, for example.

You create a rule override in the Properties view of the relevant artifact, with the overridden rules property. Click the . . . button next to the property name, and click Add to add rules to be overridden by the current artifact. In the Values for overridden rules dialog, enter one of the following attributes:
  • The name of the rule that you want this artifact to override

  • The name of each rule that you want this artifact to override, separated by commas; or

  • Select from a list by clicking the . . . button.

Screenshot of the overriddenRules property
Note: To be able to edit the property, make sure that the hand icon Hand icon to make properties editable is visible next to the Value column header in the Properties view.

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 are 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. Only r3 and r4 are left, and run if their conditions are met.