Developers want to pass parameters from outside the promotion evaluation process, to use them in their new condition evaluators and action executors without the need to override ruleset and promotion calculation rule (Recipe: How Can I Add a New Action Type?).
This functionality uses a CalculationContext
object to store the parameters. The CalculationContext
object gets passed through the promotion evaluation process. In a CalculationRule
object a PromotionEvaluationObjects
object is created and receives the custom parameters from the Context object. The PromotionEvaluationObjects
is passed to objects of classes which implement the interface PromotionConditionEvaluator
or PromotionActionExecutor
where the custom parameters can be used.