Class PromotionRuleCompilerListener
java.lang.Object
de.hybris.platform.promotionengineservices.compiler.listeners.PromotionRuleCompilerListener
- All Implemented Interfaces:
RuleCompilerListener
Implementation of
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCompile(RuleCompilerContext context) Handles a notification that the compilation for a particularRuleCompilerContexthas just been completed.voidafterCompileError(RuleCompilerContext context) Handles a notification that the compilation for a particularRuleCompilerContextfailed.voidbeforeCompile(RuleCompilerContext context) Handles a notification that the compilation for a particularRuleCompilerContextis about to begin.protected voidCleans previously stored parameter values for given context for all conditions.protected voidextractAndStoreParamValues(PromotionSourceRuleModel rule, String moduleName, 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> protected EngineRuleDaoprotected ModelServicevoidsetConditionResolutionStrategies(Map<String, ConditionResolutionStrategy> conditionResolutionStrategies) voidsetEngineRuleDao(EngineRuleDao engineRuleDao) voidsetModelService(ModelService modelService)
-
Constructor Details
-
PromotionRuleCompilerListener
public PromotionRuleCompilerListener()
-
-
Method Details
-
beforeCompile
Description copied from interface:RuleCompilerListenerHandles a notification that the compilation for a particularRuleCompilerContextis about to begin.- Specified by:
beforeCompilein interfaceRuleCompilerListener- Parameters:
context- - theRuleCompilerContext
-
cleanStoredParameterValues
Cleans previously stored parameter values for given context for all conditions.- Parameters:
context-RuleCompilerContextto clean the parameter values for.
-
afterCompile
Description copied from interface:RuleCompilerListenerHandles a notification that the compilation for a particularRuleCompilerContexthas just been completed.- Specified by:
afterCompilein interfaceRuleCompilerListener- Parameters:
context- - theRuleCompilerContext
-
extractAndStoreParamValues
protected void extractAndStoreParamValues(PromotionSourceRuleModel rule, String moduleName, List<RuleConditionData> conditions) Parse rule parameters of specific types (like list of products or categories) and store them in the database.- Parameters:
rule- rule to get and store parameter values forconditions- rule conditions
-
afterCompileError
Description copied from interface:RuleCompilerListenerHandles a notification that the compilation for a particularRuleCompilerContextfailed.- Specified by:
afterCompileErrorin interfaceRuleCompilerListener- Parameters:
context- - theRuleCompilerContext
-
getModelService
-
setModelService
-
getEngineRuleDao
-
setEngineRuleDao
-
getConditionResolutionStrategies
-
setConditionResolutionStrategies
public void setConditionResolutionStrategies(Map<String, ConditionResolutionStrategy> conditionResolutionStrategies)
-