Limiting the Number of Triggered Rules

A limit can be specified for the number of maximum rules that can be triggered. This is useful for when rules are evaluated such as promotions being calculated for a cart. Setting a limit leads to noticeable memory consumption and CPU usage reduction.

There are two strategies provided to achieve this:

  • CartBasedMaxRuleExecutionsFunction: limits the number of rules allowed. It is based on a customizable minimum value together with the overall quantity of items in the cart. This strategy is used by default.
    1. The minimum value can be configured via the system property promotionengineservices.evaluation.rule.executions.min. The defulat minimum value is set to 10.
    2. Example: A cart is evaluated for promotions. It contains 5x Product A and 3x Product Y. The maximum number of rules triggered amounts to: 5 + 3 (total quantity in cart) + 10 (minimum value) = 18.
  • DefaultMaxRuleExecutionsFunction: no limit to the number of rules that can be triggered. The response returned is -1. No performance improvements are achieved with this strategy.