public abstract class AbstractRuleActionStrategy<RULE_BASED_ACTION extends AbstractRuleBasedPromotionActionModel> extends Object implements RuleActionStrategy
| Constructor and Description |
|---|
AbstractRuleActionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
createActionUUID()
Creates a new unique id to identify an action instance.
|
protected RULE_BASED_ACTION |
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 CalculationService |
getCalculationService() |
protected ExtendedOrderDao |
getExtendedOrderDao() |
protected Boolean |
getForceImmediateRecalculation() |
protected List<RuleActionMetadataHandler> |
getMetadataHandlers(String mdKey) |
protected ModelService |
getModelService() |
protected Class<RULE_BASED_ACTION> |
getPromotionAction() |
protected PromotionActionService |
getPromotionActionService() |
protected Map<String,List<RuleActionMetadataHandler>> |
getRuleActionMetadataHandlers() |
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 |
setBeanName(String beanName) |
void |
setCalculationService(CalculationService calculationService) |
void |
setExtendedOrderDao(ExtendedOrderDao extendedOrderDao) |
void |
setForceImmediateRecalculation(Boolean forceImmediateRecalculation) |
void |
setModelService(ModelService modelService) |
void |
setPromotionAction(Class<RULE_BASED_ACTION> promotionAction) |
void |
setPromotionActionService(PromotionActionService promotionActionService) |
void |
setRuleActionMetadataHandlers(Map<String,List<RuleActionMetadataHandler>> ruleActionMetadataHandlers) |
protected AbstractOrderModel |
undoInternal(RULE_BASED_ACTION 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 RULE_BASED_ACTION 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 List<RuleActionMetadataHandler> getMetadataHandlers(String mdKey)
protected AbstractOrderModel undoInternal(RULE_BASED_ACTION 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 static String createActionUUID()
UUID.randomUUID()protected 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 Class<RULE_BASED_ACTION> getPromotionAction()
public void setPromotionAction(Class<RULE_BASED_ACTION> promotionAction)
protected PromotionActionService getPromotionActionService()
public void setPromotionActionService(PromotionActionService promotionActionService)
protected Boolean getForceImmediateRecalculation()
public void setForceImmediateRecalculation(Boolean forceImmediateRecalculation)
protected CalculationService getCalculationService()
public void setCalculationService(CalculationService calculationService)
public void setBeanName(String beanName)
public String getStrategyId()
RuleActionStrategygetStrategyId in interface RuleActionStrategyprotected Map<String,List<RuleActionMetadataHandler>> getRuleActionMetadataHandlers()
public void setRuleActionMetadataHandlers(Map<String,List<RuleActionMetadataHandler>> ruleActionMetadataHandlers)
Copyright © 2017 SAP SE. All Rights Reserved.