com.ibm.commerce.marketing.promotion.reward

Interface Reward

  • All Superinterfaces:
    java.io.Serializable, XMLizable
    All Known Implementing Classes:
    DefaultReward


    public interface Reward
    extends XMLizable
    Reward interface encapsulates all the AdjustmentFunctions of a Reward. A Reward can have many AdjustmentFunctions.
    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • getAdjustmentFunctions

        AdjustmentFunction[] getAdjustmentFunctions()
        Gets AdjustmentFunctions of the Reward.
        Returns:
        list of AdjustmentFunction
      • setAdjustmentFunctions

        void setAdjustmentFunctions(AdjustmentFunction[] adjustmentList)
        Sets AdjustmentFunctions for the Reward.
        Parameters:
        adjustmentList - list of AdjustmentFunction
      • computeReward

        boolean computeReward(PromotionContext context,
                              PromotionExecutionRecord record)
                       throws PromotionRewardCalcuationException
        computeReward method applies the adjustments to the targeted line items. It gets the targeted items from PromotionExecutionRecord. For each AdjustmentFunction, it finds affected items by applying filters to the targetted line items. PromotionExecutionRecord that is passed as argument is populated with all the adjustments and affected line items. This record is appended to PromotionContext.
        Parameters:
        context - PromotionContext.
        record - PromotionExecutionRecord.
        Throws:
        PromotionRewardCalcuationException - when the computation encounters an unexpected error.
        PromotionRewardCalcuationException