What if an attribute value is set by a default value as well as a business rule? What if both a business rule and a decision table exist for the same attribute? How is the sequence affected when the attribute default is a reference to a decision table? etc.

The inference engine first checks whether an attribute is user-set.
  - If so, all rules and defaults are ignored.

If not, the inference engine tries to find a rule amongst all decision tables, business rules, external rules and data rules that can set the attribute. Therefore the inference engine evaluates the condition of these rules.
  - If more than rule is found that can actually set the attribute, an error is displayed.
  - If exactly one rule is found that can set the attribute, that particular rule is fired.
  - If no rule is found that can set the attribute, the default value (default constant, default expression, default decision table or default external rule) is used to set the attribute.

If no such default value (constant, expression, external rule or decision table) is found, the value remains unknown.
Furthermore, if any afore mentioned rule is part of a rule group, the participation of such rules is determined by the precondition of the rule group. In other words, if an attribute is not user-set and there is a decision table that could set it, but it is part of a rule group that has a precondition that is not met, the decision table does not participate.
In case of inheritance, the inference engine will start searching for a way to derive the value of an attribute (a decision table, business rule, external rule or data rule) at the most specific level (the derived entity). If none exist there or their conditions are not satisfied, then the inference engine will look at the generic level (the base entity).

In case of specialization, the most specialized rule is used. Inheritance has a higher priority however, i.e. if you have a rule in the lower module for the derived entity, it has priority over a specialized ruled for the generic entity. If you have defined two rules that both derive the same attribute, one in the lower module and one in the higher module, then both are used, and you get an error in case they derive a different value.



  • No labels