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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconverts the given set of PKs to source rule model objects.protected voiddoRuleDeployment(String moduleName, List<SourceRuleModel> rules) protected booleanwhether to fail on any error or ignore them (set viaruleengineservices.system.setup.failOnErrorsystem property, defaults to true.protected ConfigurationServiceprotected Stringprotected ModelServiceprotected RuleEngineServiceprotected RuleMaintenanceServiceprotected Predicate<SourceRuleModel><T extends AbstractRulesModule>
voidinitializeModule(T module) Performs initialization of the provided (jalo) rules module.protected voidThis method is called byApplicationListener.onApplicationEvent(ApplicationEvent)and processes the given event.voidregisterSourceRuleForDeployment(SourceRule sourceRule, String... moduleNames) registers a (jalo) SourceRule to be compiled and deployed for the given moduleNames after the next initialization.voidregisterSourceRulesForDeployment(Collection<SourceRuleModel> sourceRules, Collection<String> moduleNames) registers a collection of SourceRules to be compiled and deployed for the given moduleNames after the next initialization.voidsetConfigurationService(ConfigurationService configurationService) voidsetModelService(ModelService modelService) voidsetRuleEngineService(RuleEngineService ruleEngineService) voidsetRuleMaintenanceService(RuleMaintenanceService ruleMaintenanceService) voidsetSourceRuleModelValidator(Predicate<SourceRuleModel> sourceRuleModelValidator) protected <T extends AbstractRulesModuleModel>
Optional<T>validateAndConvertFromJalo(AbstractRulesModule rulesModule) protected <T extends SourceRuleModel>
Optional<T>validateAndConvertFromJalo(SourceRule sourceRule) Methods inherited from class de.hybris.platform.servicelayer.event.impl.AbstractEventListener
afterPropertiesSet, onApplicationEvent, setApplicationContext, setClusterService, setTenantService
-
Constructor Details
-
DefaultRuleEngineSystemSetup
public DefaultRuleEngineSystemSetup()
-
-
Method Details
-
initializeModule
Description copied from interface:RuleEngineSystemSetupPerforms initialization of the provided (jalo) rules module. This method is intended to be used from within impex scripts.- Specified by:
initializeModulein interfaceRuleEngineSystemSetup- Parameters:
module- Jalo representation of rules module to be initialized
-
registerSourceRuleForDeployment
Description copied from interface:RuleEngineSystemSetupregisters 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:
registerSourceRuleForDeploymentin interfaceRuleEngineSystemSetup- Parameters:
sourceRule- the source rule to be registered for deploymentmoduleNames- the target module(s) by name
-
registerSourceRulesForDeployment
public void registerSourceRulesForDeployment(Collection<SourceRuleModel> sourceRules, Collection<String> moduleNames) Description copied from interface:RuleEngineSystemSetupregisters 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:
registerSourceRulesForDeploymentin interfaceRuleEngineSystemSetup- Parameters:
sourceRules- the source rules to be registered for deploymentmoduleNames- the target modules by name
-
onEvent
Description copied from class:AbstractEventListenerThis method is called byApplicationListener.onApplicationEvent(ApplicationEvent)and processes the given event.- Specified by:
onEventin classAbstractEventListener<AfterInitializationEndEvent>- Parameters:
event- the event to be processed- See Also:
-
ApplicationListener.onApplicationEvent(ApplicationEvent)
-
doRuleDeployment
-
getInitializationEventType
-
validateAndConvertFromJalo
-
validateAndConvertFromJalo
protected <T extends AbstractRulesModuleModel> Optional<T> validateAndConvertFromJalo(AbstractRulesModule rulesModule) -
validateAndConvertFromJalo
-
failOnError
protected boolean failOnError()whether to fail on any error or ignore them (set viaruleengineservices.system.setup.failOnErrorsystem property, defaults to true.- Returns:
- whether to fail on any error or not
-
convert
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
-
getRuleMaintenanceService
-
setRuleMaintenanceService
-
getModelService
-
setModelService
-
getConfigurationService
-
setConfigurationService
-
getSourceRuleModelValidator
-
setSourceRuleModelValidator
-
getRuleEngineService
-
setRuleEngineService
-