Interface Reward

  • All Superinterfaces:, XMLizable
    All Known Implementing Classes:

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


        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.
        list of AdjustmentFunction
      • setAdjustmentFunctions

        void setAdjustmentFunctions(AdjustmentFunction[] adjustmentList)
        Sets AdjustmentFunctions for the Reward.
        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.
        context - PromotionContext.
        record - PromotionExecutionRecord.
        PromotionRewardCalcuationException - when the computation encounters an unexpected error.