public interface RuleEngineKieModuleSwapper
| Modifier and Type | Method and Description |
|---|---|
String |
activateKieModule(DroolsKIEModuleModel module)
Updates the instance of
DroolsKIEModuleModel with information about affectively deployed ReleaseId
version |
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 |
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 |
Optional<ReleaseId> |
getDeployedReleaseId(DroolsKIEModuleModel module,
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
|
boolean |
removeKieModuleIfPresent(ReleaseId releaseId,
RuleEngineActionResult result)
Tries to remove the
KieModule with given ReleaseId from org.kie.api.builder.KieRepository |
void |
setUpKieServices()
Initializes the
org.kie.api.KieServices instance |
List<Object> |
switchKieModule(DroolsKIEModuleModel module,
RuleEngineActionResult result,
KieContainerListener listener,
LinkedList<Supplier<Object>> postTaskList)
Swaps synchroneously to a new KieModule.
|
void |
switchKieModuleAsync(String moduleName,
RuleEngineActionResult result,
KieContainerListener listener,
List<Object> resultsAccumulator,
LinkedList<Supplier<Object>> postTaskList)
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 |
List<Object> switchKieModule(DroolsKIEModuleModel module, RuleEngineActionResult result, KieContainerListener listener, LinkedList<Supplier<Object>> postTaskList)
module - instance of the AbstractRulesModuleModel moduleresult - instance of RuleEngineActionResult to be used in cluster nodes notificationlistener - 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 instancesvoid switchKieModuleAsync(String moduleName, RuleEngineActionResult result, KieContainerListener listener, List<Object> resultsAccumulator, LinkedList<Supplier<Object>> postTaskList)
moduleName - kie module nameresult - instance of RuleEngineActionResult to be used in cluster nodes notificationlistener - 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-taskspostTaskList - chain of post-task operations incapsulated as a linked list of Supplier instances<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 initializedString 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
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 DroolsKIEModuleModelReleaseIdOptional<ReleaseId> getDeployedReleaseId(DroolsKIEModuleModel module, 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()
static 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 © 2017 SAP SE. All Rights Reserved.