Class DefaultSequenceBuilder

  • java.lang.Object
  • All Implemented Interfaces:
    PromotionExecutionSequenceBuilder, XMLizable,

    public class DefaultSequenceBuilder
    extends java.lang.Object
    implements PromotionExecutionSequenceBuilder
    This is the default sequence builder for promotion engine. When multiple promotions are applicable to an order (or even the same item), it solves the confliction through the application of promotion policies. This class builds a list of promotions by their priorities using a linear insertion algorithm. The priority of promotion is defined as follows:
    1. Coupon takes the highest precedence, a promotion for which a coupon is entered is attempted before a promotion for which a coupon is not entered.
    2. Promotions for which a promotion code is entered are attempted before the promotions for which a promotion code is not entered. This doesn't include the case when there is a coupon entered for the second promotion.
    3. When all is equal, the promotion specified in a group defined more early in the promotion invocation template will be invoked first. The promotion that is in a group defined later in the template will be invoked after.
    4. For promotions in the same group, when all is equal, the one with a higher priority will be invoked first. The one that has a lower priority will be invoked after.
    See Also:
    Serialized Form
    • Field Summary

      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Vector buildSequence(PromotionContext context)
      Builds the sequences in which promotions are attempted at runtime.
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait