Class DefaultRuleEngineSystemSetup

java.lang.Object
de.hybris.platform.servicelayer.event.impl.AbstractEventListener<AfterInitializationEndEvent>
de.hybris.platform.ruleengineservices.maintenance.systemsetup.impl.DefaultRuleEngineSystemSetup
All Implemented Interfaces:
RuleEngineSystemSetup, EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<AfterInitializationEndEvent>

public class DefaultRuleEngineSystemSetup extends AbstractEventListener<AfterInitializationEndEvent> implements RuleEngineSystemSetup
The default implementation for RuleEngineSystemSetupService. This setup class allows to register source rules for deployment after system initialization.
  • Constructor Details

    • DefaultRuleEngineSystemSetup

      public DefaultRuleEngineSystemSetup()
  • Method Details

    • initializeModule

      public <T extends AbstractRulesModule> void initializeModule(T module)
      Description copied from interface: RuleEngineSystemSetup
      Performs initialization of the provided (jalo) rules module. This method is intended to be used from within impex scripts.
      Specified by:
      initializeModule in interface RuleEngineSystemSetup
      Parameters:
      module - Jalo representation of rules module to be initialized
    • registerSourceRuleForDeployment

      public void registerSourceRuleForDeployment(SourceRule sourceRule, String... moduleNames)
      Description copied from interface: RuleEngineSystemSetup
      registers a (jalo) SourceRule to be compiled and deployed for the given moduleNames after the next initialization. This method is intended to be used from within impex scripts.
      Specified by:
      registerSourceRuleForDeployment in interface RuleEngineSystemSetup
      Parameters:
      sourceRule - the source rule to be registered for deployment
      moduleNames - the target module(s) by name
    • registerSourceRulesForDeployment

      public void registerSourceRulesForDeployment(Collection<SourceRuleModel> sourceRules, Collection<String> moduleNames)
      Description copied from interface: RuleEngineSystemSetup
      registers a collection of SourceRules to be compiled and deployed for the given moduleNames after the next initialization. This call will register all given source rules for all given module names.
      Specified by:
      registerSourceRulesForDeployment in interface RuleEngineSystemSetup
      Parameters:
      sourceRules - the source rules to be registered for deployment
      moduleNames - the target modules by name
    • onEvent

      protected void onEvent(AfterInitializationEndEvent event)
      Description copied from class: AbstractEventListener
      This method is called by ApplicationListener.onApplicationEvent(ApplicationEvent) and processes the given event.
      Specified by:
      onEvent in class AbstractEventListener<AfterInitializationEndEvent>
      Parameters:
      event - the event to be processed
      See Also:
      • ApplicationListener.onApplicationEvent(ApplicationEvent)
    • doRuleDeployment

      protected void doRuleDeployment(String moduleName, List<SourceRuleModel> rules)
    • getInitializationEventType

      protected String getInitializationEventType(AfterInitializationEndEvent event)
    • validateAndConvertFromJalo

      protected <T extends SourceRuleModel> Optional<T> validateAndConvertFromJalo(SourceRule sourceRule)
    • validateAndConvertFromJalo

      protected <T extends AbstractRulesModuleModel> Optional<T> validateAndConvertFromJalo(AbstractRulesModule rulesModule)
    • validateAndConvertFromJalo

      protected <T extends ItemModel> Optional<T> validateAndConvertFromJalo(PK pk)
    • failOnError

      protected boolean failOnError()
      whether to fail on any error or ignore them (set via ruleengineservices.system.setup.failOnError system property, defaults to true.
      Returns:
      whether to fail on any error or not
    • convert

      protected <T extends ItemModel> List<T> convert(Set<PK> pks)
      converts the given set of PKs to source rule model objects.
      Parameters:
      pks - the set of pks
      Returns:
      the list of source rule models
    • getInitializationMap

      protected Map<String,Set<PK>> getInitializationMap()
    • getRuleMaintenanceService

      protected RuleMaintenanceService getRuleMaintenanceService()
    • setRuleMaintenanceService

      public void setRuleMaintenanceService(RuleMaintenanceService ruleMaintenanceService)
    • getModelService

      protected ModelService getModelService()
    • setModelService

      public void setModelService(ModelService modelService)
    • getConfigurationService

      protected ConfigurationService getConfigurationService()
    • setConfigurationService

      public void setConfigurationService(ConfigurationService configurationService)
    • getSourceRuleModelValidator

      protected Predicate<SourceRuleModel> getSourceRuleModelValidator()
    • setSourceRuleModelValidator

      public void setSourceRuleModelValidator(Predicate<SourceRuleModel> sourceRuleModelValidator)
    • getRuleEngineService

      protected RuleEngineService getRuleEngineService()
    • setRuleEngineService

      public void setRuleEngineService(RuleEngineService ruleEngineService)