drools

Can't deploy artifact to KIE-server via Drools workbench because of “ConversationId not valid - missing releaseId”

落爺英雄遲暮 提交于 2019-12-11 06:39:12
问题 I'm using the, kie-server-showcase and drools-workbench-showcase, via docker-run, I can see the kie-server in the drools UI and deploy a build to it. However, when I use docker-compose, I get a runtime exception when trying to deploy the demo morgauge project, see the logs here: http://pastebin.com/qKQ8hgak, but I've included the interesting parts: kie-server | 15:24:41,268 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 15690ms - Started 406 of

How to automatically format drools files with Eclipse?

孤者浪人 提交于 2019-12-11 06:26:13
问题 For our current project we have code formatting rules for java and xml files. Is there some way to configure Eclipse to format drools files (*.drl)? 回答1: As far as I know you can't. The current plugin doesn't format the DRL files. It can be a very good contribution to the project :) Cheers 来源: https://stackoverflow.com/questions/7723078/how-to-automatically-format-drools-files-with-eclipse

Integrating Drools with a pre-existing eclipse project

我们两清 提交于 2019-12-11 06:24:44
问题 This is my first time using Drools and am looking to integrate it with a pre-existing eclipse project. I am using the Drools eclipse plugin. I can successfully create a Drools project and run it without error. However, when I try and use Drools in a normal Java project (the project that existed before I had installed the Drools plugin) I receive a NullPointerException and debugging shows that my KieSession is null: KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks

Drools - check if exists/contains string in a List<String>

我们两清 提交于 2019-12-11 05:41:59
问题 I need to create a rule to check if a part of string exists inside a List[String]. Is there a way that i could do it? I'm trying using contains but it's not working. rule "New Assistance" when $room:Room($tags : tags) //$room:Room(tags contains "protocol") $value:String() from $tags //Boolean(booleanValue == true) from $value == "protocol" Boolean(booleanValue == true) from $value.contains("protocol") then System.out.println("Error"); end And here is my code ... val room = new Room(null, List

Summing values of an object's map gives me errors

一世执手 提交于 2019-12-11 04:14:12
问题 A SubjectTeacherPeriod has a num_attribute_map , which is a map that maps certain attributes (such as "boringness") with their respective scores. I use the following code to sum attributes (such as "boringness") over each day of the week. But a certain line causes an error. rule "insertAttributeDayTotal" //salience 1 // Do these rules first (optional, for performance) when $sum_regression_constraint : SumRegressionConstraint( $class : class_, $attribute : attribute//, //$weight : weight; )

How to parameterize the after temporal constraint in Drools?

帅比萌擦擦* 提交于 2019-12-11 03:58:47
问题 I have a rule very similar to the following example: rule "correlate orders" when $bo : BuyOrderEvent( $id : id ) $ae : AckEvent( id == $id, this after[0,10s] $bo ) then // do something end But I would like to parameterize the time (10 seconds in this example). I tried using a String variable but I get: java.lang.RuntimeException: Error parsing time string: [ $t1.max ] Any ideas on how to achieve this? 来源: https://stackoverflow.com/questions/58195212/how-to-parameterize-the-after-temporal

Drools: Match local string from array in LHS of rule

一笑奈何 提交于 2019-12-11 03:43:26
问题 I am trying to create rules in which I check if a string is in a list of strings in the LHS of my rule. The list of strings to compare to is constant and known at the time of rule creation, but differs among many similar rules. An example rule is as such (the way I am writing them now): rule "ruleX" when $a: MyObject() then List<String> list = new ArrayList<String>(); list.add("ABC"); list.add("DEF"); if (list.contains($a.getString()) { //do stuff } end This will not take advantage of the

Add new rule file to an existing knowledge session

与世无争的帅哥 提交于 2019-12-11 03:42:45
问题 I want to add a new rule-file (or modify an already existing one) to an existing KieSession dynamically at runtime. I found an answer regarding this and tried the solution mentioned there, but got a runtime exception. The code used is as follows: Driver.java : package app1; import java.io.FileInputStream; import java.io.FileNotFoundException; import org.kie.api.KieBase; import org.kie.api.KieServices; import org.kie.api.builder.KieBuilder; import org.kie.api.builder.KieFileSystem; import org

Optaplanner 7.13.0 cant be executed from a jar file

假如想象 提交于 2019-12-11 03:19:29
问题 I am building a project using optaplanner jar to solve a vehicle routing problem. After building the jar, I am unable to invoke the main class and this is the error I get: 513 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Loading kie.conf from jar:file:/Users/meena/Documents/SourceCode/Comma_code/comma_code/sources/target/comma-1.0-SNAPSHOT-jar-with-dependencies.jar!/META-INF/kie.conf in classloader sun.misc.Launcher$AppClassLoader@55f96302 515 [main] INFO org.kie.api.internal

Gradle Drools 6.2 Could not resolve all dependencies for configuration ':compile'

[亡魂溺海] 提交于 2019-12-11 02:56:57
问题 I'm trying to pull in Drools 6.2 using gradle and keep getting the following error. I read that it could be an issue with repos that have poms, but not jars, but that doesn't seem to be the case. Frankly I'm a bit stuck and don't know how to proceed here. Could not resolve all dependencies for configuration ':compile'. > Could not resolve org.kie:kie-api:6.2.0.Final. Required by: 1:1:1 > Could not resolve org.kie:kie-api:6.2.0.Final. > Could not parse POM http://repo1.maven.org/maven2/org/kie