Promotion evaluation sequence development details
The following table shows an example of data in a Promotion Execution Agenda:
Promotions | Policies | |||||||
---|---|---|---|---|---|---|---|---|
Global Policies | Group G1 | Group G2 | ||||||
Policy 1 | Policy 2 | Policy 3 | Policy 4 | Policy 5 | Policy 6 | Policy 7 | ||
Group G1 | Promotion A | X | X | X | X | |||
Promotion B | X | X | X | X | ||||
Promotion C | X | X | X | X | ||||
Promotion D | X | X | X | X | ||||
Promotion E | X | X | X | X | ||||
Group G2 | Promotion F | X | X | X | X | X | ||
Promotion G | X | X | X | X | X |
The table contains the promotions and the policies that govern them. The table also displays how the promotions are grouped, and to which groups each policy applies. The promotion engine creates a Promotion Execution Agenda, which is based on information that is contained in the invocation template. The invocation template is specified in the call to the promotion engine. By default, an invocation template is a preconfigured list of promotion groups that will be evaluated during the call to the promotion engine.
When a promotion is identified for evaluation, all the constraints and conditions that are associated with the promotion are evaluated. Rewards are calculated if the promotion is applicable to the current order. When the evaluation of a promotion is complete, one or more PromotionExecutionRecords are created, depending on how many times this promotion can be applied to this order. The promotion engine then determineswhether any promotion policies are violated by applying this promotion to the order on top of other promotions that are applied already. If no policies violations are found, the PromotionExecutionRecord is added to the result and the PromotionEngine evaluates the next promotion. This process continues until all promotions in the sequence are evaluated. Most of the methods on the PromotionContext class are defined to support this process.