Package com.skava.promotion.rule.process
Class PromotionRuleExecuter
java.lang.Object
com.skava.promotion.rule.process.PromotionRuleExecuter
- All Implemented Interfaces:
com.skava.core.rules.engine.RuleActionListener
public class PromotionRuleExecuter
extends Object
implements com.skava.core.rules.engine.RuleActionListener
This class contains the functionality to evaluate the rules to perform
action.
- Since:
- 8.0
- Version:
- 8.0
- Author:
- Infosys Equinox
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPromotionRuleExecuter(PromotionOfferDO promotionOfferDO, PromotionProcess promotionProcess, PromotionActionsOrder[] promotionActionsOrder) -
Method Summary
Modifier and TypeMethodDescriptionexecuteRules(long collectionId, CollectionAttributeProcess collectionAttributeProcess, String[] ruleTypes, long previewTime) executeRules(long collectionId, CollectionAttributeProcess collectionAttributeProcess, String[] ruleTypes, long previewTime, CustomRuleFactsProcessor customRuleFactsProcessor) voidonActionSuccess(com.skava.core.rules.engine.model.RuleActionInfo ruleActionInfo) Executes after completion of an action.voidExecutes after the completion of rule execution.voidonFireAllRulesFinish(com.skava.core.rules.engine.model.RuleRequest ruleRequest) Executes after execution of the entire rules.voidExecutes when the base constraints of the action were met.
-
Field Details
-
COUPON
- See Also:
-
-
Constructor Details
-
PromotionRuleExecuter
public PromotionRuleExecuter(PromotionOfferDO promotionOfferDO, PromotionProcess promotionProcess, PromotionActionsOrder[] promotionActionsOrder)
-
-
Method Details
-
executeRules
public PromotionOfferDO executeRules(long collectionId, CollectionAttributeProcess collectionAttributeProcess, String[] ruleTypes, long previewTime) - Parameters:
collectionId- Collection Id under which rules needs to be processed.collectionAttributeProcess-ruleTypes- RuleTypes specifies the rule type(s) to be executed which is configured in collection properties.previewTime- PreviewTime specifies the time in milliseconds since the UNIX epoch (January 1, 1970 00:00:00 UTC) at which the promotions are previewed.- Returns:
- returns the instance of promotion offerDO
-
executeRules
public PromotionOfferDO executeRules(long collectionId, CollectionAttributeProcess collectionAttributeProcess, String[] ruleTypes, long previewTime, CustomRuleFactsProcessor customRuleFactsProcessor) - Parameters:
collectionId- Collection Id under which rules needs to be processed.ruleTypes- RuleTypes specifies the rule type(s) to be executed which is configured in collection properties.previewTime- PreviewTime specifies the time in milliseconds since the UNIX epoch (January 1, 1970 00:00:00 UTC) at which the promotions are previewed.customRuleFactsProcessor- - custom rule facts processor- Returns:
- It returns the instance of
PromotionOfferDO
-
onSuccess
Executes when the base constraints of the action were met.- Specified by:
onSuccessin interfacecom.skava.core.rules.engine.RuleActionListener- Parameters:
ruleId- Id of the rule.isGroup- if it is true the given rule is group.facts- Instance ofObject.
-
onActionSuccess
public void onActionSuccess(com.skava.core.rules.engine.model.RuleActionInfo ruleActionInfo) Executes after completion of an action.- Specified by:
onActionSuccessin interfacecom.skava.core.rules.engine.RuleActionListener- Parameters:
ruleActionInfo- Instance ofRuleActionInfo.
-
onFinish
Executes after the completion of rule execution. -
onFireAllRulesFinish
public void onFireAllRulesFinish(com.skava.core.rules.engine.model.RuleRequest ruleRequest) Executes after execution of the entire rules.- Specified by:
onFireAllRulesFinishin interfacecom.skava.core.rules.engine.RuleActionListener- Parameters:
ruleRequest- Holds the instance ofRuleRequest.
-