public class DefaultCommerceRuleEngineService extends java.lang.Object implements RuleEngineService
| Constructor and Description |
|---|
DefaultCommerceRuleEngineService() |
| Modifier and Type | Method and Description |
|---|---|
protected RuleEngineResultRAO |
addRuleEngineResultRAO(RuleEvaluationContext context)
Adds a RuleEngineResultRAO to the facts of this context if it doesn't exist already.
|
RuleEngineActionResult |
archiveRule(AbstractRuleEngineRuleModel ruleEngineRule)
Deprecated.
since 1811
|
RuleEngineActionResult |
archiveRule(AbstractRuleEngineRuleModel ruleEngineRule,
AbstractRulesModuleModel rulesModule)
Deprecated.
since 1811
|
<T extends DroolsRuleModel> |
archiveRules(java.util.Collection<T> engineRules)
Archive a collection of rules
|
<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 EngineRuleDao |
getEngineRuleDao() |
protected java.util.Set<java.lang.Object> |
getEventListners(DroolsRuleEngineContextModel ruleEngineContext) |
protected FactContextFactory |
getFactContextFactory() |
protected RuleEngineService |
getPlatformRuleEngineService() |
protected ProcessEventListenerFactory |
getProcessEventListenerFactory() |
protected RAOProvider |
getRuleConfigurationProvider() |
AbstractRuleEngineRuleModel |
getRuleForCodeAndModule(java.lang.String code,
java.lang.String moduleName)
Finds AbstractRuleEngineRuleModel for given code and module.
|
AbstractRuleEngineRuleModel |
getRuleForUuid(java.lang.String uuid)
Finds AbstractRuleEngineRuleModel for given uuid.
|
protected RAOProvider |
getRuleGroupExecutionProvider() |
protected RuleRuntimeEventListenerFactory |
getRuleRuntimeEventListenerFactory() |
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). |
void |
initialize(AbstractRulesModuleModel module,
java.lang.String deployedMvnVersion,
boolean propagateToOtherNodes,
boolean enableIncrementalUpdate,
RuleEngineActionResult result,
ExecutionContext executionContext)
Since 18.08
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). |
InitializationFuture |
initialize(java.util.List<AbstractRulesModuleModel> modules,
boolean propagateToOtherNodes,
boolean enableIncrementalUpdate,
ExecutionContext executionContext)
Since 6.7
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,
AbstractRulesModuleModel rulesModule)
Updates the given rule if it already exists.
|
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 initialize(AbstractRulesModuleModel module, java.lang.String deployedMvnVersion, boolean propagateToOtherNodes, boolean enableIncrementalUpdate, RuleEngineActionResult result, ExecutionContext executionContext)
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 initializationexecutionContext - the instance of ExecutionContext to be set as executionContext of RuleEngineActionResult if not nullpublic 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 initializationpublic 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 InitializationFuture initialize(java.util.List<AbstractRulesModuleModel> modules, boolean propagateToOtherNodes, boolean enableIncrementalUpdate, ExecutionContext executionContext)
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 moduleexecutionContext - instance of ExecutionContext that serves as a storage for initialization related dataInitializationFuture 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)
protected java.util.Set<java.lang.Object> getEventListners(DroolsRuleEngineContextModel ruleEngineContext)
protected RuleEngineResultRAO addRuleEngineResultRAO(RuleEvaluationContext context)
context - the rule engine contextprotected java.util.Set<java.lang.Object> provideRAOs(FactContext factContext)
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 clusterpublic 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)@Deprecated public RuleEngineActionResult archiveRule(AbstractRuleEngineRuleModel ruleEngineRule)
RuleEngineServicearchiveRule in interface RuleEngineServiceruleEngineRule - Rule to be archivedRuleEngineActionResult.isActionFailed() to check if the
action succeeded)@Deprecated 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 initializationpublic 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)
RuleEngineServicegetRuleForUuid in interface RuleEngineServiceuuid - the rule uuidprotected 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 © 2018 SAP SE. All Rights Reserved.