I am able to successfully integrate it now. But running in stream mode is
giving some issues
This is my code:
ks = KieServices.Factory.get();
ReleaseId releaseId1 = ks.newReleaseId("com.sample", "ceaaRules",
""
+ currentRulesVersion);
KieModuleModel kieModuleModel = ks.newKieModuleModel();
KieBaseModel kieBaseModel1 = kieModuleModel.newKieBaseModel("KBase1")
.setDefault(true)
.setEqualsBehavior(EqualityBehaviorOption.EQUALITY)
.setEventProcessingMode(EventProcessingOption.STREAM);
KieSessionModel kieSessionModel1 = kieBaseModel1
.newKieSessionModel("KSession1").setDefault(true)
.setType(KieSessionModel.KieSessionType.STATEFUL);
if (usePseudoClock) {
kieSessionModel1.setClockType(ClockTypeOption.get("pseudo"));
} else {
kieSessionModel1.setClockType(ClockTypeOption.get("realtime"));
}
km = createAndDeployJar(ks, releaseId1, drlInSystem);
kieContainer = ks.newKieContainer(km.getReleaseId());
KieSessionConfiguration ksc = ks.newKieSessionConfiguration();
ksc.setProperty("sessionName", "DroolsSession");
if (usePseudoClock) {
ksc.setProperty("drools.clockType", "pseudo");
} else {
ksc.setProperty("drools.clockType", "realtime");
}
ksc.setProperty("drools.eventProcessingMode",
"stream");
kSession = kieContainer.newKieSession(ksc);
However when I run it. I get this error
============================
java.lang.RuntimeException: The requested KieBase "defaultKieBase" has been
set to run in CLOUD mode but requires features only available in STREAM mode
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:400)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:346)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:498)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:443)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:434)
There is a bug logged
==================
https://issues.jboss.org/browse/RTGOV-393
Which says Stream mode is disabled for time being.
Is my understanding correct.
I am using 6.1.0.CR1 since 6.0.1.Final was having issues in writing the jar
file to kfs if the event object is declared outside of drl
http://drools.46999.n3.nabble.com/rules-users-Problem-with-declare-event-...
Thanks
--
View this message in context:
http://drools.46999.n3.nabble.com/kbase-using-kie-tp4030187p4030210.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.