summaryrefslogtreecommitdiffstats
path: root/engine-d
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2019-05-09 19:53:08 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2019-05-09 19:53:08 +0800
commit12264918fd9a69306af2abdce70576219ce36b98 (patch)
treeb4e201c8e06a91547130b54a571c9c27348a4018 /engine-d
parent0a2c2b4a057f8f07da7b126dd904893b1983fa85 (diff)
Fixed the ABATED issue for Holmes1.2.5
Change-Id: I871292541a8e6379e777a292b45650e7767ce2a1 Issue-ID: HOLMES-223 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'engine-d')
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java b/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
index c397b28..f26a03d 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/manager/DroolsEngine.java
@@ -22,9 +22,15 @@ import org.jvnet.hk2.annotations.Service;
import org.kie.api.KieServices;
import org.kie.api.builder.*;
import org.kie.api.builder.Message.Level;
+import org.kie.api.builder.model.KieBaseModel;
+import org.kie.api.builder.model.KieModuleModel;
+import org.kie.api.builder.model.KieSessionModel;
+import org.kie.api.conf.EqualityBehaviorOption;
+import org.kie.api.conf.EventProcessingOption;
import org.kie.api.io.Resource;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
+import org.kie.api.runtime.conf.ClockTypeOption;
import org.kie.api.runtime.rule.FactHandle;
import org.onap.holmes.common.api.entity.AlarmInfo;
import org.onap.holmes.common.api.entity.CorrelationRule;
@@ -271,7 +277,15 @@ public class DroolsEngine {
}
private byte[] createJar(KieServices ks, ReleaseId releaseId, List<String> drls) throws CorrelationException {
- KieFileSystem kfs = ks.newKieFileSystem().generateAndWritePomXML(releaseId);
+ KieModuleModel kieModuleModel = ks.newKieModuleModel();
+ KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel("KBase")
+ .setDefault(true)
+ .setEqualsBehavior(EqualityBehaviorOption.EQUALITY);
+ kieBaseModel.newKieSessionModel("KSession")
+ .setDefault(true)
+ .setType(KieSessionModel.KieSessionType.STATEFUL);
+ KieFileSystem kfs = ks.newKieFileSystem().writeKModuleXML(kieModuleModel.toXML()).generateAndWritePomXML(releaseId);
+
int i = 0;
for (String drl : drls) {
if (!StringUtils.isEmpty(drl)) {