Optimize Rule Evaluation

Business rules involve complex interactions between attributes from various objects. These interactions are sometimes repetitive in nature. Cartesian product condition occurs when such a rule leads to the creation of many objects (or child facts). It causes performance issues during rule evaluation.

Avoid these issues by optimizing the rule evaluation when parent and child attributes are used within the same rule. When a rule is configured using child and grandchild attributes, you must establish the relationship between them. When a rule is configured using both line and distribution attributes, establish the relationship between parent and child attributes. This ensures that only the distributions for those lines that meet the line conditions are evaluated. If such relationship isn't established, then all distributions for the invoice as a whole are evaluated for every line matching the rule conditions.

Consider an organization where the approval policy mandates that the Finance department must approve all invoices with capital expenditure more than 5000 dollars, if they are matched to a purchase order. Capital expenditures are charged to a specific account. For such invoices, the workflow administrator must configure a rule to check the following conditions:

  • Invoice amount is more than 5000.

  • Invoice line is matched to purchase order.

  • Invoice distribution account for the related lines references the capital expenditure account number.

In the basic mode, both the parent (Invoice Line) and the child (Invoice Line Distributions) attributes may be present in the same rule without any additional condition establishing their relationship.

When the basic rule is validated, BPM checks whether a join condition exists between the parent and child attributes. When a relationship doesn't exist, the business rule validation displays the message that the rule configuration ended in an inefficient rule evaluation. You can click the message link to add the missing join condition.

On clicking the message link, the Rule Recommendation dialog box displays 2 options. Here's a table describing the options and the effects of selecting them:

Option

Effect

Optimize rule definition by adding 'contains' condition automatically between parent and child facts

Selecting this option adds the additional join condition automatically between the parent and child attributes.

Edit rule in basic mode to optimize rule definition by adding join condition between parent and child facts. Alternatively, change rule to Advanced mode and optimize rule definition.

Selecting this option displays the problematic rule and condition. You can either add the join condition manually, or change the rule to Advanced mode.

You can select either option to establish the relationship between the parent and child attributes. Then, BPM validates and saves the rule.