Customizing the agenda builder
If you want to change the default logic that selects potentially applicable promotions for evaluation, or to improve system performance by screening promotions prior to evaluation to reduce the number of promotions to be evaluated at run time, customize the agenda builder. Customizing the agenda builder is a three step process.
- Implementing your Agenda Builder
The only requirement is that your agenda builder must implement the com.ibm.commerce.marketing.promotion.runtime.PromotionExecutionAgendaBuilder interface. This interface is also a subclass of XMLizable interface. As a result, define the toXML and fromXML methods for your implementation, as well as a serialized XML form for your agenda builder.
The worker method of the AgendaBuilder interface is the buildAgenda method. It takes two parameters. One is the PromotionArgument with all the input attributes set. The other is the PromotionEngine. Through the PromotionEngine parameter, you have access to useful services like the persistence manger registry and the external entity factory registry. This method returns the PromotionExecutionAgenda once it is built.
- Registering the custom agenda builder in the promotion engine configuration
Locate the following XML fragment:
<PromotionExecutionAgendaBuilder impl="com.ibm.commerce.marketing.promotion.runtime.DefaultAgendaBuilder"> . . . <!-details --> . . . </PromotionExecutionAgendaBuilder>
Since the agenda builder is initialized during WebSphere Commerce start up, a restart is required before the changes take effect.
Related concepts