public class PromotionRuleCompilerListener extends Object implements RuleCompilerListener
RuleCompilerListener that adds variables that are required for promotions. It parses and
stores parameter values for specific conditions of the rule, like product and category codes, so that they can be
used later.| Constructor and Description |
|---|
PromotionRuleCompilerListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCompile(RuleCompilerContext context)
Handles a notification that the compilation for a particular
RuleCompilerContext has just been completed. |
void |
afterCompileError(RuleCompilerContext context)
Handles a notification that the compilation for a particular
RuleCompilerContext failed. |
void |
beforeCompile(RuleCompilerContext context)
Handles a notification that the compilation for a particular
RuleCompilerContext is about to begin. |
protected void |
cleanStoredParameterValues(PromotionSourceRuleModel rule)
Cleans previously stored parameter values for given rule for all conditions.
|
protected void |
extractAndStoreParamValues(PromotionSourceRuleModel rule,
List<RuleConditionData> conditions)
Parse rule parameters of specific types (like list of products or categories) and store them in the database.
|
protected Map<String,ConditionResolutionStrategy> |
getConditionResolutionStrategies() |
protected EngineRuleDao |
getEngineRuleDao() |
protected ModelService |
getModelService() |
void |
setConditionResolutionStrategies(Map<String,ConditionResolutionStrategy> conditionResolutionStrategies) |
void |
setEngineRuleDao(EngineRuleDao engineRuleDao) |
void |
setModelService(ModelService modelService) |
public void beforeCompile(RuleCompilerContext context) throws RuleCompilerException
RuleCompilerListenerRuleCompilerContext is about to begin.beforeCompile in interface RuleCompilerListenercontext - - the RuleCompilerContextRuleCompilerException - if an error occursprotected void cleanStoredParameterValues(PromotionSourceRuleModel rule)
rule - PromotionSourceRuleModel to clean the parameter values for.public void afterCompile(RuleCompilerContext context) throws RuleCompilerException
RuleCompilerListenerRuleCompilerContext has just been completed.afterCompile in interface RuleCompilerListenercontext - - the RuleCompilerContextRuleCompilerException - if an error occursprotected void extractAndStoreParamValues(PromotionSourceRuleModel rule, List<RuleConditionData> conditions)
rule - rule to get and store parameter values forconditions - rule conditionspublic void afterCompileError(RuleCompilerContext context) throws RuleCompilerException
RuleCompilerListenerRuleCompilerContext failed.afterCompileError in interface RuleCompilerListenercontext - - the RuleCompilerContextRuleCompilerException - if an error occursprotected ModelService getModelService()
public void setModelService(ModelService modelService)
protected EngineRuleDao getEngineRuleDao()
public void setEngineRuleDao(EngineRuleDao engineRuleDao)
protected Map<String,ConditionResolutionStrategy> getConditionResolutionStrategies()
public void setConditionResolutionStrategies(Map<String,ConditionResolutionStrategy> conditionResolutionStrategies)
Copyright © 2017 SAP SE. All Rights Reserved.