public interface RuleEngineKieModuleSwapper
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
activateKieModule(DroolsKIEModuleModel module)
Updates the instance of
DroolsKIEModuleModel with information about affectively deployed ReleaseId
version |
void |
addKieBase(KieModuleModel module,
DroolsKIEBaseModel base)
Adds new
KieBaseModel to a KieModuleModel with all rules |
void |
addKieBase(KieModuleModel module,
KieFileSystem kfs,
DroolsKIEBaseModel base,
KIEModuleCacheBuilder cache)
Adds new
KieBaseModel to a KieModuleModel with all rules |
void |
addKieSession(KieBaseModel base,
DroolsKIESessionModel session)
Adds instance of new
KieSessionModel to KieBaseModel |
void |
addRules(KieFileSystem kfs,
DroolsKIEBaseModel base,
KIEModuleCacheBuilder cache)
Adds rules from a given
DroolsKIEBaseModel to KieFileSystem |
void |
addRulesToCache(DroolsKIEBaseModel base,
KIEModuleCacheBuilder cache)
Add cacheable data of rules of the latest versions belonging to the KieBase into the cache.
|
static MessageLevel |
convertLevel(Message.Level level)
converts a drools message
Level to a MessageLevel. |
<any> |
createKieModule(DroolsKIEModuleModel module,
RuleEngineActionResult result)
Creates the new instance of
KieModule, based on information contained in DroolsKIEModuleModel |
java.util.Optional<ReleaseId> |
getDeployedReleaseId(DroolsKIEModuleModel module,
java.lang.String deployedMvnVersion)
Returns (optional)
ReleaseId for a deployed version of the KieModuleModel |
static EqualityBehaviorOption |
getEqualityBehaviorOption(DroolsEqualityBehavior behavior)
converts between hybris and drools equality behavior
|
static EventProcessingOption |
getEventProcessingOption(DroolsEventProcessingMode eventProcessingMode)
converts between hybris and drools event processing mode
|
ReleaseId |
getReleaseId(DroolsKIEModuleModel module)
Creates the new instance of
ReleaseId based on DroolsKIEModuleModel |
static KieSessionModel.KieSessionType |
getSessionType(DroolsSessionType sessionType)
converts between hybris and drools session type
|
KieContainer |
initializeNewKieContainer(DroolsKIEModuleModel module,
KieModule kieModule,
RuleEngineActionResult result)
Creates the new instance of
KieContainer for a given KieModule |
boolean |
removeKieModuleIfPresent(ReleaseId releaseId,
RuleEngineActionResult result)
Tries to remove the
KieModule with given ReleaseId from org.kie.api.builder.KieRepository |
boolean |
removeOldKieModuleIfPresent(RuleEngineActionResult result)
Tries to remove the old
KieModule from org.kie.api.builder.KieRepository |
void |
setUpKieServices()
Initializes the
org.kie.api.KieServices instance |
java.util.List<java.lang.Object> |
switchKieModule(DroolsKIEModuleModel module,
KieContainerListener listener,
java.util.LinkedList<java.util.function.Supplier<java.lang.Object>> postTaskList,
boolean enableIncrementalUpdate,
RuleEngineActionResult result)
Swaps synchroneously to a new KieModule.
|
void |
switchKieModuleAsync(java.lang.String moduleName,
KieContainerListener listener,
java.util.List<java.lang.Object> resultsAccumulator,
java.util.function.Supplier<java.lang.Object> resetFlagSupplier,
java.util.List<java.util.function.Supplier<java.lang.Object>> postTaskList,
boolean enableIncrementalUpdate,
RuleEngineActionResult result)
Swaps asynchroneously to a new KieModule.
|
void |
waitForSwappingToFinish()
Block until the whole swapping task/tasks are finished
|
void |
writeKModuleXML(KieModuleModel module,
KieFileSystem kfs)
Creates the XML representation of
KieModuleModel and writes it to KieFileSystem |
void |
writePomXML(DroolsKIEModuleModel module,
KieFileSystem kfs)
Write the building POM XML to
KieFileSystem |
java.util.List<java.lang.Object> switchKieModule(DroolsKIEModuleModel module, KieContainerListener listener, java.util.LinkedList<java.util.function.Supplier<java.lang.Object>> postTaskList, boolean enableIncrementalUpdate, RuleEngineActionResult result)
module - instance of the AbstractRulesModuleModel modulelistener - instance of KieContainerListener that fires when the switch of Kie Container is completepostTaskList - chain of post-task operations incapsulated as a linked list of Supplier instancesenableIncrementalUpdate - flag, if true, enables for incremental updates of the rule engine kie moduleresult - instance of RuleEngineActionResult to be used in cluster nodes notificationvoid switchKieModuleAsync(java.lang.String moduleName,
KieContainerListener listener,
java.util.List<java.lang.Object> resultsAccumulator,
java.util.function.Supplier<java.lang.Object> resetFlagSupplier,
java.util.List<java.util.function.Supplier<java.lang.Object>> postTaskList,
boolean enableIncrementalUpdate,
RuleEngineActionResult result)
moduleName - kie module namelistener - instance of KieContainerListener that fires when the switch of Kie Container is completeresultsAccumulator - the list that will contain the method execution results including the post-tasksresetFlagSupplier - the task to perform after the sync call finishes the task (whether it was successfull or not )postTaskList - chain of post-task operations incapsulated as a linked list of Supplier instancesenableIncrementalUpdate - flag, if true, enables for incremental updates of the rule engine kie moduleresult - instance of RuleEngineActionResult to be used in cluster nodes notificationKieContainer initializeNewKieContainer(DroolsKIEModuleModel module, KieModule kieModule, RuleEngineActionResult result)
KieContainer for a given KieModulemodule - instance of DroolsKIEModuleModelkieModule - instance of KieModuleresult - instance of RuleEngineActionResult to be used in cluster nodes notificationKieContainer instance<any> createKieModule(DroolsKIEModuleModel module, RuleEngineActionResult result)
KieModule, based on information contained in DroolsKIEModuleModelmodule - instance of DroolsKIEModuleModelresult - instance of RuleEngineActionResult to be used in cluster nodes notificationKieModule and the corresponding caching structure for the
created modulevoid addKieBase(KieModuleModel module,
KieFileSystem kfs,
DroolsKIEBaseModel base,
KIEModuleCacheBuilder cache)
KieBaseModel to a KieModuleModel with all rulesmodule - instance of KieModuleModel to add the KieBaseModel tokfs - instance of KieFileSystembase - instance of DroolsKIEBaseModel that keeps the information for a KieBaseModel to be
createdcache - the caching structure for the module being initializedvoid addKieBase(KieModuleModel module,
DroolsKIEBaseModel base)
KieBaseModel to a KieModuleModel with all rulesmodule - instance of KieModuleModel to add the KieBaseModel tobase - instance of DroolsKIEBaseModel that keeps the information for a KieBaseModel to be
createdjava.lang.String activateKieModule(DroolsKIEModuleModel module)
DroolsKIEModuleModel with information about affectively deployed ReleaseId
versionmodule - instance of DroolsKIEModuleModelReleaseIdboolean removeKieModuleIfPresent(ReleaseId releaseId,
RuleEngineActionResult result)
KieModule with given ReleaseId from org.kie.api.builder.KieRepositoryreleaseId - the instance of ReleaseId corresponding to a KieModule to be removedresult - instance of RuleEngineActionResult to be used in cluster nodes notification
removalboolean removeOldKieModuleIfPresent(RuleEngineActionResult result)
KieModule from org.kie.api.builder.KieRepositoryresult - instance of RuleEngineActionResult to be used in cluster nodes notification
removalvoid addKieSession(KieBaseModel base,
DroolsKIESessionModel session)
KieSessionModel to KieBaseModelbase - instance of KieBaseModelsession - instance of DroolsKIESessionModel containing the information for new KieSessionModelvoid addRules(KieFileSystem kfs,
DroolsKIEBaseModel base,
KIEModuleCacheBuilder cache)
DroolsKIEBaseModel to KieFileSystemkfs - instance of KieFileSystembase - instance of DroolsKIEBaseModel containing the reference to the rules to publishcache - the caching structure for the module being initializedvoid writeKModuleXML(KieModuleModel module,
KieFileSystem kfs)
KieModuleModel and writes it to KieFileSystemmodule - instance of KieModuleModelkfs - instance of KieFileSystemvoid writePomXML(DroolsKIEModuleModel module, KieFileSystem kfs)
KieFileSystemmodule - instance of DroolsKIEModuleModel to be used for ReleaseId creationkfs - instance of KieFileSystemReleaseId getReleaseId(DroolsKIEModuleModel module)
ReleaseId based on DroolsKIEModuleModelmodule - instance of DroolsKIEModuleModelReleaseIdjava.util.Optional<ReleaseId> getDeployedReleaseId(DroolsKIEModuleModel module, java.lang.String deployedMvnVersion)
ReleaseId for a deployed version of the KieModuleModelmodule - instance of DroolsKIEModuleModeldeployedMvnVersion - currently deployed releaseId version of the Kie Module, if knownOptional.of(ReleaseId) if the ReleaseId could be created,
Optional.empty() otherwisevoid setUpKieServices()
org.kie.api.KieServices instancevoid waitForSwappingToFinish()
void addRulesToCache(DroolsKIEBaseModel base, KIEModuleCacheBuilder cache)
base - KieBase of the rules to be processedcache - CacheBuilder to cache rule datastatic KieSessionModel.KieSessionType getSessionType(DroolsSessionType sessionType)
static EqualityBehaviorOption getEqualityBehaviorOption(DroolsEqualityBehavior behavior)
static EventProcessingOption getEventProcessingOption(DroolsEventProcessingMode eventProcessingMode)
static MessageLevel convertLevel(Message.Level level)
Level to a MessageLevel.Copyright © 2018 SAP SE. All Rights Reserved.