Develop > Presentation layer > Customize promotions > Promotion engine customization > Customization scenarios


Customize the agenda builder

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 runtime, you can customize the agenda builder. A WCS instance has only one agenda builder. Customizations apply to all stores in the same instance.


Procedure

  1. Implement the agenda builder. The only requirement is that the 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 the 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.

  2. Register 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>
    

    1. Replace the value of the impl attribute with the fully qualified class name of the own implementation.

    2. Replace the content of the XML elements with the serialized XML for the agenda builder.

  3. Restart WebSphere Commerce. Since the agenda builder is initialized during WebSphere Commerce start up, a restart is required before the changes take effect.


Related concepts

Agenda builder

Related reference

Customization scenarios


+

Search Tips   |   Advanced Search