atg.commerce.pricing
Interface PricingModelEvaluationVetoer

All Known Implementing Classes:
PricingModelEvaluationSiteVetoer

public interface PricingModelEvaluationVetoer

Interface to implement a promotion evaluation vetoer. Allows promotions to be vetoed before being evaluated. Vetoers can be configured for a pricing engine. The engine will first call the prepareForVetoing method before iterating over the promotions and calling the vetoPromotion method.

See Also:
PricingEngineService.mPricingModelEvaluationVetoers

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Method Summary
 java.lang.Object prepareForVetoing(PricingEngineService pPricingEngine, PricingContext pPricingContext, java.util.Map pExtraParametersMap)
          Prepares a vetoer for vetoing promotions.
 java.lang.String vetoPromotion(PricingEngineService pPricingEngine, PricingContext pPricingContext, java.util.Map pExtraParametersMap, java.lang.Object pVetoParam)
          Allows the promotion in pPricingContext to be vetoed.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Method Detail

prepareForVetoing

java.lang.Object prepareForVetoing(PricingEngineService pPricingEngine,
                                   PricingContext pPricingContext,
                                   java.util.Map pExtraParametersMap)

Prepares a vetoer for vetoing promotions.

This allows a vetoer to inspect the pricing context and extract any information needed to do it's vetoing. e.g. a sku vetoer might extract the skus from the order. This information can be returned from this method as an Object which will subsequently be passed into the vetoPromotion method for vetoing each promotion.

An implementation should only return null if it's vetoPromotion method should not be subsequently called for each promotion.

Parameters:
pPricingEngine - PricingEngineService that called this vetoer
pPricingContext - PricingContext for this pricing operation
pExtraParametersMap - Map of extra parameters if needed
Returns:
Object that will be passed into vetoPromotion or null if this vetoer should not be used.
See Also:
vetoPromotion(PricingEngineService, PricingContext, Map, Object)

vetoPromotion

java.lang.String vetoPromotion(PricingEngineService pPricingEngine,
                               PricingContext pPricingContext,
                               java.util.Map pExtraParametersMap,
                               java.lang.Object pVetoParam)

Allows the promotion in pPricingContext to be vetoed.

A vetoer could inspect the pricing context or use the passed in pVetoParam Object to decide whether the promotion should be vetoed.

Parameters:
pPricingEngine - PricingEngineService that called this vetoer
pPricingContext - PricingContext including the promotion to be checked
pExtraParametersMap - Map of extra parameters if needed
pVetoParam - Object returned by prepareForVetoing method, guaranteed to not be null.
Returns:
null if the promotion should not be vetoed else a String describing why the promotion was vetoed.
See Also:
prepareForVetoing(PricingEngineService, PricingContext, Map)