kie

Executing Kiebase (instance retrieved from cache) takes more time to fire all rules as compared to when KieBase instance is retrieved from in-memory

≡放荡痞女 提交于 2020-03-04 17:20:58
问题 On builiding knowledge base KieBase for the first time, we are storing its instance in cache so that we can save build time by using this cached instance. I noticed that when this instance is directly used x no. of times, it takes very very less time to fire all rules , BUT when we use cached instance then firing all rules takes more time. Here is the time taken by kieSession.fireAllRules() when KieBase instance is taken from in-memory (i.e. KieBase instance is used directly) min: 0 ms, max:

Optoplanner/jsprit TSPTW with real road distance

我们两清 提交于 2019-12-25 09:17:50
问题 Is it possible to solve asymmetric -travelling sales man problem with time window (with the real road distances) with optoplanner or jsprit? if you are able to provide any documentation or pointer in this regard that is highly appreciated. thanks. 回答1: With OptaPlanner, there is a Vehicle Routing Problem example that supports asymmetric distances and time windows. So just give it only 1 vehicle and you got the Traveling Sales Man variant of that. Look for the code in this directory: see

Java-Spark-Drools : Exception in thread “main” java.lang.RuntimeException: Cannot find a default KieBase

99封情书 提交于 2019-12-25 00:56:41
问题 I have below code which is calling drools rule engine from spark. Spark Version : 2.3.0 KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); ClassTag<KieBase> classTagTest = scala.reflect.ClassTag$.MODULE$.apply(KieBase.class); Broadcast<KieBase> broadcastRules = context.broadcast(kContainer.getKieBase(), classTagTest); finalJoined.foreach(row -> droolprocess(broadcastRules.value(),row)); here finalJoined is of type Dataset<Row> public static

Java 8, Drools 5.x and Drools 7.x

蹲街弑〆低调 提交于 2019-12-24 23:15:12
问题 I am using Drools 5.x (drools-compiler 5.2.1.Final, drools-decisiontables 5.4.0.Final, and drools-templates 5.4.0.Final; jbpm-flow 5.1.1.Final, jbpm-bmpn2 5.1.1.Final and with their respective dependencies) for my Java job, I build/run it with Java 1.7.0_21. My current set up works properly. I am using a decision table (spreadsheet). I am able to build/run my project with Java 1.8.0_162 using drools 5.x as described above; however, when the java job runs it loads the decision table

Accessing KieSession from jbpm6 WorkItemHandler

微笑、不失礼 提交于 2019-12-24 04:22:42
问题 I'm using jbpm-console (6.0.0.Final) with custom work item handlers. I've embedded a custom work item handlers JAR in my jbpm-console WAR as described in post #7 here: https://community.jboss.org/thread/221748 This is all fine so far, as I can successful start a process definition in jbpm-console, and it kicks off my custom WorkItemHandler code. However, in my WorkItemHandler, I want to set some variables on the ProcessInstance. When I try something like this: public void executeWorkItem

Exception Child services have no parent when starting Optaplanner application

旧时模样 提交于 2019-12-22 18:14:14
问题 I have a test program that uses optaplanner. There is no direct use of KIE API's but it looks like they are being invoked behind the scenes. This may be related to the fact that I am using DROOLS for the score calculation. The program works from the IDE or through maven, but I want to create a standalone jar that will not require maven. I used the maven assembly plugin to build a fat jar with all dependencies included to be run standalone. When I run java -jar target/OptaPlannerTest-1.4

How to dynamically change the rules of a given Drools 6.3 session?

偶尔善良 提交于 2019-12-21 17:51:41
问题 I have a session in Drools 6.3.x containing e few million facts. I'm building an interactive application that, among other things, allows the user to filter the facts as he wants. In my mind, this filter is basically a pattern. Once the facts are filtered, the logic is applied to produce the desired result. Due to the interactive nature of the application, I'd rather not to wait for the user input to build a KieBase , derive a KieSession , load the few million facts and fire the rules all the

Drools 6.4 KieScanner : How create and add Jar with rules in Maven?

会有一股神秘感。 提交于 2019-12-21 06:25:26
问题 I am a beginner with Drools and Maven and I am facing a problem to load rules with KieScanner. The aim of the project is to be able to dynamically load rules in a permanent KieSession. I wonder if it is possible to manage rules with the KieFileSystem (not sure it is possible without a dispose of the session and starting another one leading to the lack of the previous inserted facts), but the good way is to use KieScanner. It seems this requires the creation of a Jar containing the rules and

How to integrate KIE Workbench 6.1.0.Final (Drools Guvnor) Project with Java Application

点点圈 提交于 2019-12-18 09:12:35
问题 I am using KIE Workbench 6.1.0.Final and my Eclipse project where I am trying to execute rules is also 6.1.0 Runtime enabled. I like to know how I can execute/load rules created using Drools Guvnor, from my java application. Before posting this question, I have looked at the following similar questions and tried the given approaches but none of them worked for me. Integrating Drool 6 work bench with Java Application why does loading Drools 6 KIE JAR into code fail? Loading Drools/KIE

Drools 6: add rules to a running KieSession

删除回忆录丶 提交于 2019-12-18 03:46:52
问题 till now I couldn't figure out the best way (meaning with minimal overhead) to add rules to a running KieSession in Drools 6.0.0 AND still keeping my facts in KieSession. In Drools 5 the KSession was updated when KBase was changed, but the same seems not be true for Drools 6 since my rules are not created in the KieBase. Is there a way to do it without replacing whole KieModules or Jars in the KieFileSystem. I think there should be an easy way to it. Do you guys have an idea? Regards 回答1: Yes