Class PromotionRuleCompilerListener
- java.lang.Object
-
- de.hybris.platform.promotionengineservices.compiler.listeners.PromotionRuleCompilerListener
-
- All Implemented Interfaces:
RuleCompilerListener
public class PromotionRuleCompilerListener extends java.lang.Object implements RuleCompilerListener
Implementation ofRuleCompilerListenerthat 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 Constructor Description PromotionRuleCompilerListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCompile(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 voidcleanStoredParameterValues(RuleCompilerContext context)Cleans previously stored parameter values for given context for all conditions.protected voidextractAndStoreParamValues(PromotionSourceRuleModel rule, java.lang.String moduleName, java.util.List<RuleConditionData> conditions)Parse rule parameters of specific types (like list of products or categories) and store them in the database.protected java.util.Map<java.lang.String,ConditionResolutionStrategy>getConditionResolutionStrategies()protected EngineRuleDaogetEngineRuleDao()protected ModelServicegetModelService()voidsetConditionResolutionStrategies(java.util.Map<java.lang.String,ConditionResolutionStrategy> conditionResolutionStrategies)voidsetEngineRuleDao(EngineRuleDao engineRuleDao)voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
beforeCompile
public void beforeCompile(RuleCompilerContext context)
Description copied from interface:RuleCompilerListenerHandles a notification that the compilation for a particularRuleCompilerContextis about to begin.- Specified by:
beforeCompilein interfaceRuleCompilerListener- Parameters:
context- - theRuleCompilerContext
-
cleanStoredParameterValues
protected void cleanStoredParameterValues(RuleCompilerContext context)
Cleans previously stored parameter values for given context for all conditions.- Parameters:
context-RuleCompilerContextto clean the parameter values for.
-
afterCompile
public void afterCompile(RuleCompilerContext context)
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, java.lang.String moduleName, java.util.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
public void afterCompileError(RuleCompilerContext context)
Description copied from interface:RuleCompilerListenerHandles a notification that the compilation for a particularRuleCompilerContextfailed.- Specified by:
afterCompileErrorin interfaceRuleCompilerListener- Parameters:
context- - theRuleCompilerContext
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getEngineRuleDao
protected EngineRuleDao getEngineRuleDao()
-
setEngineRuleDao
public void setEngineRuleDao(EngineRuleDao engineRuleDao)
-
getConditionResolutionStrategies
protected java.util.Map<java.lang.String,ConditionResolutionStrategy> getConditionResolutionStrategies()
-
setConditionResolutionStrategies
public void setConditionResolutionStrategies(java.util.Map<java.lang.String,ConditionResolutionStrategy> conditionResolutionStrategies)
-
-