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 Details

  • Constructor Details

  • 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

      public void onSuccess(String ruleId, boolean isGroup, Object... facts)
      Executes when the base constraints of the action were met.
      Specified by:
      onSuccess in interface com.skava.core.rules.engine.RuleActionListener
      Parameters:
      ruleId - Id of the rule.
      isGroup - if it is true the given rule is group.
      facts - Instance of Object.
    • onActionSuccess

      public void onActionSuccess(com.skava.core.rules.engine.model.RuleActionInfo ruleActionInfo)
      Executes after completion of an action.
      Specified by:
      onActionSuccess in interface com.skava.core.rules.engine.RuleActionListener
      Parameters:
      ruleActionInfo - Instance of RuleActionInfo.
    • onFinish

      public void onFinish(String ruleId, boolean isGroup, Set<Object> ruleFacts)
      Executes after the completion of rule execution.
      Specified by:
      onFinish in interface com.skava.core.rules.engine.RuleActionListener
      Parameters:
      ruleId - Id of the rule.
      isGroup - if it is true the given rule is group.
      ruleFacts - Instance of Set<Object>.
    • onFireAllRulesFinish

      public void onFireAllRulesFinish(com.skava.core.rules.engine.model.RuleRequest ruleRequest)
      Executes after execution of the entire rules.
      Specified by:
      onFireAllRulesFinish in interface com.skava.core.rules.engine.RuleActionListener
      Parameters:
      ruleRequest - Holds the instance of RuleRequest.