public abstract class AbstractRuleActionStrategy<A extends AbstractRuleBasedPromotionActionModel> extends java.lang.Object implements RuleActionStrategy
| Constructor and Description |
|---|
AbstractRuleActionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected A |
createPromotionAction(PromotionResultModel promotionResult,
AbstractRuleActionRAO action)
Creates an instance of the configured
promotionAction (which is a subtype of RuleBasedPromotionActionModel,
sets a new unique UUID, sets this strategy's id, marks the action as
applied, attaches the given promotionResult and tries to lookup the rule which created the given
AbstractRuleActionRAO. |
protected ActionUtils |
getActionUtils() |
protected CalculationService |
getCalculationService() |
protected ExtendedOrderDao |
getExtendedOrderDao() |
protected java.lang.Boolean |
getForceImmediateRecalculation() |
protected java.util.List<RuleActionMetadataHandler> |
getMetadataHandlers(java.lang.String mdKey) |
protected ModelService |
getModelService() |
protected java.lang.Class<A> |
getPromotionAction() |
protected PromotionActionService |
getPromotionActionService() |
protected PromotionResultUtils |
getPromotionResultUtils() |
protected java.util.Map<java.lang.String,java.util.List<RuleActionMetadataHandler>> |
getRuleActionMetadataHandlers() |
java.lang.String |
getStrategyId()
Returns this strategy's unique Id
|
protected void |
handleActionMetadata(AbstractRuleActionRAO action,
AbstractRuleBasedPromotionActionModel actionModel) |
protected void |
handleUndoActionMetadata(AbstractRuleBasedPromotionActionModel action) |
protected boolean |
recalculateIfNeeded(AbstractOrderModel order)
recalculates the given
order if the #forceImmediateRecalculation flag is set to true. |
void |
setActionUtils(ActionUtils actionUtils) |
void |
setBeanName(java.lang.String beanName) |
void |
setCalculationService(CalculationService calculationService) |
void |
setExtendedOrderDao(ExtendedOrderDao extendedOrderDao) |
void |
setForceImmediateRecalculation(java.lang.Boolean forceImmediateRecalculation) |
void |
setModelService(ModelService modelService) |
void |
setPromotionAction(java.lang.Class<A> promotionAction) |
void |
setPromotionActionService(PromotionActionService promotionActionService) |
void |
setPromotionResultUtils(PromotionResultUtils promotionResultUtils) |
void |
setRuleActionMetadataHandlers(java.util.Map<java.lang.String,java.util.List<RuleActionMetadataHandler>> ruleActionMetadataHandlers) |
protected AbstractOrderModel |
undoInternal(A action)
removes the given
action (if it is not already removed), its associated DiscountValues and its
PromotionResult (if the PromotionResult has no other actions associated with it). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapply, undoprotected A createPromotionAction(PromotionResultModel promotionResult, AbstractRuleActionRAO action)
promotionAction (which is a subtype of RuleBasedPromotionActionModel,
sets a new unique UUID, sets this strategy's id, marks the action as
applied, attaches the given promotionResult and tries to lookup the rule which created the given
AbstractRuleActionRAO.
Note: the action is created through the modelService, but it is not saved.promotionResult - the promotionResult that the to-be-created promotion action belongs toaction - the action raoprotected void handleActionMetadata(AbstractRuleActionRAO action, AbstractRuleBasedPromotionActionModel actionModel)
protected void handleUndoActionMetadata(AbstractRuleBasedPromotionActionModel action)
protected java.util.List<RuleActionMetadataHandler> getMetadataHandlers(java.lang.String mdKey)
protected AbstractOrderModel undoInternal(A action)
action (if it is not already removed), its associated DiscountValues and its
PromotionResult (if the PromotionResult has no other actions associated with it).action - the action to undoprotected boolean recalculateIfNeeded(AbstractOrderModel order)
order if the #forceImmediateRecalculation flag is set to true.order - the order to recalculateprotected ExtendedOrderDao getExtendedOrderDao()
public void setExtendedOrderDao(ExtendedOrderDao extendedOrderDao)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected java.lang.Class<A> getPromotionAction()
public void setPromotionAction(java.lang.Class<A> promotionAction)
protected PromotionActionService getPromotionActionService()
public void setPromotionActionService(PromotionActionService promotionActionService)
protected java.lang.Boolean getForceImmediateRecalculation()
public void setForceImmediateRecalculation(java.lang.Boolean forceImmediateRecalculation)
protected CalculationService getCalculationService()
public void setCalculationService(CalculationService calculationService)
public void setBeanName(java.lang.String beanName)
public java.lang.String getStrategyId()
RuleActionStrategygetStrategyId in interface RuleActionStrategyprotected java.util.Map<java.lang.String,java.util.List<RuleActionMetadataHandler>> getRuleActionMetadataHandlers()
public void setRuleActionMetadataHandlers(java.util.Map<java.lang.String,java.util.List<RuleActionMetadataHandler>> ruleActionMetadataHandlers)
protected PromotionResultUtils getPromotionResultUtils()
public void setPromotionResultUtils(PromotionResultUtils promotionResultUtils)
protected ActionUtils getActionUtils()
public void setActionUtils(ActionUtils actionUtils)
Copyright © 2018 SAP SE. All Rights Reserved.