public class DefaultCommerceRuleEngineService extends java.lang.Object implements RuleEngineService
| Constructor and Description |
|---|
DefaultCommerceRuleEngineService() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<java.lang.Object> |
addRuleConfigurationFacts(java.util.Collection<DroolsRuleModel> rules)
Deprecated.
since 6.3 this method is not invoked anymore during
evaluate(RuleEvaluationContext). Instead
RuleConfigurationRRDs are created using the DefaultCommerceRuleEngineCacheService. |
protected RuleEngineResultRAO |
addRuleEngineResultRAO(RuleEvaluationContext context)
Adds a RuleEngineResultRAO to the facts of this context if it doesn't exist already.
|
protected java.util.Collection<java.lang.Object> |
addRuleGroupExecutionFacts(java.util.Collection<DroolsRuleModel> rules)
Deprecated.
since 6.3 this method is not invoked anymore during
evaluate(RuleEvaluationContext). Instead
RuleGroupExecutionRRDs are created using the DefaultCommerceRuleEngineCacheService. |
RuleEngineActionResult |
archiveRule(AbstractRuleEngineRuleModel ruleEngineRule)
Archives the given rule if it already exists.
|
RuleEngineActionResult |
archiveRule(AbstractRuleEngineRuleModel ruleEngineRule,
AbstractRulesModuleModel rulesModule)
Archives the given rule if it already exists.
|
<T extends DroolsRuleModel> |
archiveRules(java.util.Collection<T> engineRules)
Archive a collection of rules
|
protected void |
checkIfBeanDefinedPreviously(java.util.Map<java.lang.Object,DroolsRuleModel> duplicateGlobalsCheckMap,
DroolsRuleModel rule,
java.util.Map.Entry<java.lang.String,java.lang.String> entry,
java.lang.Object bean,
java.lang.Object oldBean)
Deprecated.
since 6.3 (used during
getGlobals(Collection), this method is no longer invoked. |
<T extends AbstractRuleEngineRuleModel> |
deactivateRulesModuleEngineRules(java.lang.String moduleName,
java.util.Collection<T> engineRules)
make the specified collection of engine rules belonging to a specified module inactive, so that the engine wouln't take them
in consideration during init
|
RuleEvaluationResult |
evaluate(RuleEvaluationContext context)
Since 6.0
Executes rule evaluation for given RuleEvaluationContext.
|
protected AgendaEventListenerFactory |
getAgendaEventListenerFactory() |
protected AgendaFilterFactory |
getAgendaFilterFactory() |
protected ConfigurationService |
getConfigurationService() |
protected java.util.Collection<DroolsRuleModel> |
getDroolsRulesForContext(DroolsRuleEngineContextModel ruleEngineContext,
java.util.List<AbstractRuleEngineRuleModel> activeRulesForModule)
Deprecated.
since 6.3 rules are no longer iterated through during rule evaluation. Instead the
RuleEngineCacheService is used. |
protected EngineRuleDao |
getEngineRuleDao() |
protected java.util.Set<java.lang.Object> |
getEventListners(DroolsRuleEngineContextModel ruleEngineContext) |
protected FactContextFactory |
getFactContextFactory() |
protected java.util.Map<java.lang.String,java.lang.Object> |
getGlobals(java.util.Collection<DroolsRuleModel> rules)
Deprecated.
since 6.3 this method is no longer invoked during
evaluate(RuleEvaluationContext). Instead
the globals are cached in DefaultPlatformRuleEngineService during
DefaultPlatformRuleEngineService.initialize(AbstractRulesModuleModel, String, boolean, boolean,
RuleEngineActionResult) and injected in
the DefaultPlatformRuleEngineService.evaluate(RuleEvaluationContext) call. |
protected RuleEngineService |
getPlatformRuleEngineService() |
protected ProcessEventListenerFactory |
getProcessEventListenerFactory() |
protected RAOProvider |
getRuleConfigurationProvider() |
AbstractRuleEngineRuleModel |
getRuleForCode(java.lang.String code)
Deprecated.
since 6.4
|
AbstractRuleEngineRuleModel |
getRuleForCodeAndModule(java.lang.String code,
java.lang.String moduleName)
Finds AbstractRuleEngineRuleModel for given code and module.
|
AbstractRuleEngineRuleModel |
getRuleForUuid(java.lang.String uuid) |
protected RAOProvider |
getRuleGroupExecutionProvider() |
AbstractRulesModuleModel |
getRuleModuleForRule(AbstractRuleEngineRuleModel rule)
Deprecated.
since 6.3
|
protected RuleRuntimeEventListenerFactory |
getRuleRuntimeEventListenerFactory() |
RuleEngineActionResult |
initialize(AbstractRulesModuleModel abstractModule)
Deprecated.
since 6.4
|
RuleEngineActionResult |
initialize(AbstractRulesModuleModel abstractModule,
boolean propagateToOtherNodes)
Deprecated.
since 6.3. Please use
initialize(AbstractRulesModuleModel, String, boolean, boolean,
RuleEngineActionResult) initialize} method instead |
RuleEngineActionResult |
initialize(AbstractRulesModuleModel abstractModule,
java.lang.String deployedReleaseIdVersion,
boolean propagateToOtherNodes)
Deprecated.
since 6.4
|
void |
initialize(AbstractRulesModuleModel module,
java.lang.String deployedMvnVersion,
boolean propagateToOtherNodes,
boolean enableIncrementalUpdate,
RuleEngineActionResult result)
Since 6.4
Initializes the given rules module (and if
propagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes). |
InitializationFuture |
initialize(java.util.List<AbstractRulesModuleModel> modules,
boolean propagateToOtherNodes,
boolean enableIncrementalUpdate)
Since 6.4
Initializes the given rules module in blocking/async mode (depending on blocking param) (and if
propagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes). |
java.util.List<RuleEngineActionResult> |
initializeAllRulesModules()
Initializes all
AbstractRulesModuleModels that are marked as active (in case of cluster mode - on all the
nodes). |
java.util.List<RuleEngineActionResult> |
initializeAllRulesModules(boolean propagateToOtherNodes)
Initializes all
AbstractRulesModuleModels that are marked as active. |
void |
initializeNonBlocking(AbstractRulesModuleModel module,
java.lang.String deployedReleaseIdVersion,
boolean propagateToOtherNodes,
boolean enableIncrementalUpdate,
RuleEngineActionResult result)
Since 6.4
Asynchronously initializes the given rules module (and if
propagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes). |
protected void |
logContextFacts(RuleEvaluationContext context) |
protected java.util.Set<java.lang.Object> |
provideRAOs(FactContext factContext) |
void |
setAgendaEventListenerFactory(AgendaEventListenerFactory agendaEventListenerFactory) |
void |
setAgendaFilterFactory(AgendaFilterFactory agendaFilterFactory) |
void |
setConfigurationService(ConfigurationService configurationService) |
void |
setEngineRuleDao(EngineRuleDao engineRuleDao) |
void |
setFactContextFactory(FactContextFactory factContextFactory) |
void |
setPlatformRuleEngineService(RuleEngineService ruleEngineService) |
void |
setProcessEventListenerFactory(ProcessEventListenerFactory processEventListenerFactory) |
void |
setRuleConfigurationProvider(RAOProvider ruleConfigurationProvider) |
void |
setRuleGroupExecutionProvider(RAOProvider ruleGroupExecutionProvider) |
void |
setRuleRuntimeEventListenerFactory(RuleRuntimeEventListenerFactory ruleRuntimeEventListenerFactory) |
RuleEngineActionResult |
updateEngineRule(AbstractRuleEngineRuleModel ruleEngineRule)
Deprecated.
since 6.3
|
RuleEngineActionResult |
updateEngineRule(AbstractRuleEngineRuleModel ruleEngineRule,
AbstractRulesModuleModel rulesModule)
Updates the given rule if it already exists.
|
@Deprecated public RuleEngineActionResult initialize(AbstractRulesModuleModel abstractModule, boolean propagateToOtherNodes)
initialize(AbstractRulesModuleModel, String, boolean, boolean,
RuleEngineActionResult) initialize} method insteadRuleEngineServicepropagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes).initialize in interface RuleEngineServiceabstractModule - the module to be initializedpropagateToOtherNodes - if true propagates a RuleEngineInitializedEvent to other nodes.RuleEngineActionResult.isActionFailed() to check if the
action succeeded)@Deprecated public RuleEngineActionResult initialize(AbstractRulesModuleModel abstractModule, java.lang.String deployedReleaseIdVersion, boolean propagateToOtherNodes)
RuleEngineServicepropagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes).initialize in interface RuleEngineServiceabstractModule - the module to be initializeddeployedReleaseIdVersion - currently deployed mvn version of the rule engine modulepropagateToOtherNodes - if true propagates a RuleEngineInitializedEvent to other nodes.RuleEngineActionResult.isActionFailed() to check if the
action succeeded)public void initialize(AbstractRulesModuleModel module, java.lang.String deployedMvnVersion, boolean propagateToOtherNodes, boolean enableIncrementalUpdate, RuleEngineActionResult result)
RuleEngineServicepropagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes).initialize in interface RuleEngineServicemodule - the module to be initializeddeployedMvnVersion - currently deployed mvn version of the rule engine modulepropagateToOtherNodes - if true propagates a RuleEngineInitializedEvent to other nodes.enableIncrementalUpdate - flag, if true, enables for incremental updates of the rule engine kie moduleresult - the instance of RuleEngineActionResult accumulating the results of initializationpublic void initializeNonBlocking(AbstractRulesModuleModel module, java.lang.String deployedReleaseIdVersion, boolean propagateToOtherNodes, boolean enableIncrementalUpdate, RuleEngineActionResult result)
RuleEngineServicepropagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes).initializeNonBlocking in interface RuleEngineServicemodule - the module to be initializeddeployedReleaseIdVersion - currently deployed version of the Kie ModulepropagateToOtherNodes - if true propagates a RuleEngineInitializedEvent to other nodes.enableIncrementalUpdate - flag, if true, enables for incremental updates of the rule engine kie moduleresult - the instance of RuleEngineActionResult accumulating the results of initialization@Deprecated public RuleEngineActionResult initialize(AbstractRulesModuleModel abstractModule)
RuleEngineServiceRuleEngineInitializedEvent to other nodes.initialize in interface RuleEngineServiceabstractModule - the module to be initializedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public InitializationFuture initialize(java.util.List<AbstractRulesModuleModel> modules, boolean propagateToOtherNodes, boolean enableIncrementalUpdate)
RuleEngineServicepropagateToOtherNodes is set to true propagates a
RuleEngineInitializedEvent to other nodes).initialize in interface RuleEngineServicemodules - the modules to be initializedpropagateToOtherNodes - if true propagates a RuleEngineInitializedEvent to other nodes.enableIncrementalUpdate - flag, if true, enables for incremental updates of the rule engine kie moduleInitializationFuture to be used for eventual blocking on multiple parallel swappingpublic RuleEvaluationResult evaluate(RuleEvaluationContext context)
RuleEngineServiceevaluate in interface RuleEngineServicecontext - the rule engine context containing data about rule engine executionpublic <T extends AbstractRuleEngineRuleModel> void deactivateRulesModuleEngineRules(java.lang.String moduleName, java.util.Collection<T> engineRules)
RuleEngineServicedeactivateRulesModuleEngineRules in interface RuleEngineServiceT - a type of engine rulesmoduleName - Name of the module the rules should refer to when applying changesengineRules - A collection of AbstractRuleEngineRuleModel to be deactivatedprotected void logContextFacts(RuleEvaluationContext context)
@Deprecated protected java.util.Collection<DroolsRuleModel> getDroolsRulesForContext(DroolsRuleEngineContextModel ruleEngineContext, java.util.List<AbstractRuleEngineRuleModel> activeRulesForModule)
RuleEngineCacheService is used.protected java.util.Set<java.lang.Object> getEventListners(DroolsRuleEngineContextModel ruleEngineContext)
protected RuleEngineResultRAO addRuleEngineResultRAO(RuleEvaluationContext context)
context - the rule engine context@Deprecated protected java.util.Collection<java.lang.Object> addRuleGroupExecutionFacts(java.util.Collection<DroolsRuleModel> rules)
evaluate(RuleEvaluationContext). Instead
RuleGroupExecutionRRDs are created using the DefaultCommerceRuleEngineCacheService.rules - the rules for which to add the rule group execution facts@Deprecated protected java.util.Collection<java.lang.Object> addRuleConfigurationFacts(java.util.Collection<DroolsRuleModel> rules)
evaluate(RuleEvaluationContext). Instead
RuleConfigurationRRDs are created using the DefaultCommerceRuleEngineCacheService.rules - the rules for which to add the configuration factsprotected java.util.Set<java.lang.Object> provideRAOs(FactContext factContext)
@Deprecated protected java.util.Map<java.lang.String,java.lang.Object> getGlobals(java.util.Collection<DroolsRuleModel> rules)
evaluate(RuleEvaluationContext). Instead
the globals are cached in DefaultPlatformRuleEngineService during
DefaultPlatformRuleEngineService.initialize(AbstractRulesModuleModel, String, boolean, boolean,
RuleEngineActionResult) and injected in
the DefaultPlatformRuleEngineService.evaluate(RuleEvaluationContext) call.rules - the ruleskey global name and value spring bean to be set as the global@Deprecated protected void checkIfBeanDefinedPreviously(java.util.Map<java.lang.Object,DroolsRuleModel> duplicateGlobalsCheckMap, DroolsRuleModel rule, java.util.Map.Entry<java.lang.String,java.lang.String> entry, java.lang.Object bean, java.lang.Object oldBean)
getGlobals(Collection), this method is no longer invoked.public java.util.List<RuleEngineActionResult> initializeAllRulesModules()
RuleEngineServiceAbstractRulesModuleModels that are marked as active (in case of cluster mode - on all the
nodes).initializeAllRulesModules in interface RuleEngineServiceRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public java.util.List<RuleEngineActionResult> initializeAllRulesModules(boolean propagateToOtherNodes)
RuleEngineServiceAbstractRulesModuleModels that are marked as active.initializeAllRulesModules in interface RuleEngineServicepropagateToOtherNodes - if true on all the nodes of cluster@Deprecated public RuleEngineActionResult updateEngineRule(AbstractRuleEngineRuleModel ruleEngineRule)
updateEngineRule in interface RuleEngineServiceruleEngineRule - Rule to be updatedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public RuleEngineActionResult updateEngineRule(AbstractRuleEngineRuleModel ruleEngineRule, AbstractRulesModuleModel rulesModule)
RuleEngineServiceupdateEngineRule in interface RuleEngineServiceruleEngineRule - Rule to be updatedrulesModule - AbstractRulesModuleModel where the Rule be updatedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public RuleEngineActionResult archiveRule(AbstractRuleEngineRuleModel ruleEngineRule)
RuleEngineServicearchiveRule in interface RuleEngineServiceruleEngineRule - Rule to be archivedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public RuleEngineActionResult archiveRule(AbstractRuleEngineRuleModel ruleEngineRule, AbstractRulesModuleModel rulesModule)
RuleEngineServicearchiveRule in interface RuleEngineServiceruleEngineRule - Rule to be archivedrulesModule - AbstractRulesModuleModel where the Rule is archivedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)public <T extends DroolsRuleModel> java.util.Optional<InitializationFuture> archiveRules(java.util.Collection<T> engineRules)
RuleEngineServicearchiveRules in interface RuleEngineServiceT - subtype of DroolsRuleModelengineRules - collection of DroolsRuleModel instancesInitializationFuture keeping the status of initialization@Deprecated public AbstractRuleEngineRuleModel getRuleForCode(java.lang.String code)
getRuleForCode in interface RuleEngineServicecode - the rule codepublic AbstractRuleEngineRuleModel getRuleForCodeAndModule(java.lang.String code, java.lang.String moduleName)
RuleEngineServicegetRuleForCodeAndModule in interface RuleEngineServicecode - the rule codemoduleName - the rules module namepublic AbstractRuleEngineRuleModel getRuleForUuid(java.lang.String uuid)
getRuleForUuid in interface RuleEngineServiceuuid - the rule uuid@Deprecated public AbstractRulesModuleModel getRuleModuleForRule(AbstractRuleEngineRuleModel rule)
getRuleModuleForRule in interface RuleEngineServicerule - the AbstractRuleEngineRuleModelprotected AgendaFilterFactory getAgendaFilterFactory()
public void setAgendaFilterFactory(AgendaFilterFactory agendaFilterFactory)
protected AgendaEventListenerFactory getAgendaEventListenerFactory()
public void setAgendaEventListenerFactory(AgendaEventListenerFactory agendaEventListenerFactory)
protected ProcessEventListenerFactory getProcessEventListenerFactory()
public void setProcessEventListenerFactory(ProcessEventListenerFactory processEventListenerFactory)
protected RuleRuntimeEventListenerFactory getRuleRuntimeEventListenerFactory()
public void setRuleRuntimeEventListenerFactory(RuleRuntimeEventListenerFactory ruleRuntimeEventListenerFactory)
protected RAOProvider getRuleConfigurationProvider()
public void setRuleConfigurationProvider(RAOProvider ruleConfigurationProvider)
protected RAOProvider getRuleGroupExecutionProvider()
public void setRuleGroupExecutionProvider(RAOProvider ruleGroupExecutionProvider)
protected RuleEngineService getPlatformRuleEngineService()
protected EngineRuleDao getEngineRuleDao()
public void setEngineRuleDao(EngineRuleDao engineRuleDao)
public void setPlatformRuleEngineService(RuleEngineService ruleEngineService)
protected ConfigurationService getConfigurationService()
public void setConfigurationService(ConfigurationService configurationService)
protected FactContextFactory getFactContextFactory()
public void setFactContextFactory(FactContextFactory factContextFactory)
Copyright © 2017 SAP SE. All Rights Reserved.