drools

Strange java.lang.ClassNotFoundException when compiling drools rules (v5.0.1) on Java 8 on Rule Name as class

柔情痞子 提交于 2019-12-25 01:22:23
问题 Trying to get drools to run java8 jvm (upgraded from Java6). However, compilation has failed and the goal pushed further. Did a couple of things that helped: Ecj compiler: updated to 'org.eclipse.jdt.core.compiler:ecj:4.5.1' Mvel: Using updated mvel2-2.1.3.Final.jar Additionally, added org.codehaus.janino:janino:jar:2.5.16 to compile dependency to use janino compiler as per this https://copyrightdev.tumblr.com/post/146315831773/getting-drools-5x-to-operate-smoothly-with-java-8 blog. However,

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

spring integration with drools

五迷三道 提交于 2019-12-24 23:34:29
问题 I want to integrate the drools in Spring.My spring config is: <kie:import releaseId-ref="ksession-rules2" enableScanner="true" scannerInterval="20000"/> <kie:releaseId id="ksession-rules2" groupId="com.test" artifactId="epay-risk2" version="1.0.3"/> <bean id="kiePostProcessor" class="org.kie.spring.annotations.KModuleAnnotationPostProcessor"/> I don't know why the following exception is thrown: java.lang.NoSuchMethodError: com.google.inject.Binder.bindListener(Lcom/google/inject/matcher

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

How to return a list from inside of accumulate in drl Drools?

大憨熊 提交于 2019-12-24 23:09:47
问题 Here is my rule rule "Multiple bookings via same mobile" when (stayDateGroupingIteration : StayDateGroupingDto($stayGroupedBookings : stayGroupedBookings)) and (QueryTypeDto( queryType == "multiple" )) $travellerCount :Number() from accumulate(BookingSummaryDtoList( $bookingSummaryDtoList : bookingSummaryDtoList) from $stayGroupedBookings, init( int count=0; List<String> globalList= new ArrayList(); Set<String> duplicateSet=new HashSet();), action( for(Object bookingSummary :

understanding lock-on-active with agenda-group

烂漫一生 提交于 2019-12-24 16:18:03
问题 I tried a sample example to see how lock-on-active works. When I fire the rule without using agenda-group everything seems fine. But when i uncomment the agenda-group in the below code and set focus to group "Group B" no rules are fired. Rule rule "Additional Rs.1 tax for books above Rs.10" //agenda-group "Group B" lock-on-active true when $o: Product(name=="Book",amount>10) then System.out.print($o.getAmount()+"-->"); modify ($o) { setAmount($o.getAmount()+1); } System.out.println($o

Drools date coercion and conditional OR

ぃ、小莉子 提交于 2019-12-24 15:22:13
问题 If I try a simple Drools rule with conditions on date type and uses conditional OR ( || ) I get the following error. If I change || to && it works fine. Is this a bug, known limitation or something wrong with my rule? I am using Drools 5.5.0 Final Rule file package net.madhura.drools.rules import net.madhura.drools.DateContainer; dialect "mvel" rule "Test rule" when $container: DateContainer( date >= "15-Oct-2013" || date <= "01-Oct-2013" ) then System.out.println("working"); end

Live rule creation in Drools Planner

試著忘記壹切 提交于 2019-12-24 14:37:05
问题 I am interested in creating rules for Drools Planner. I want that a user can create his own rules in a java app before starting the Drools Planner. Maybe a Drools-rule-file could be generated after the user has added his rules. Would this be possible or do I have to create the rule-file while developing the whole java application? Many thanks... 回答1: Yes it's possible. The trick is to build your own RuleBase and set it in the Planner config. See section "5.3.4.2.2. A RuleBase (possibly

Drools rules is not being fired after 3 times

China☆狼群 提交于 2019-12-24 12:22:56
问题 I have created one knowledge base, then in a loop used knowledge base to create stateless knowledge session and call execute on session, used same data for each iteration. ----- here is main function------ public static final void main(String[] args) { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource("diskRules.drl"), ResourceType.DRL); if (kbuilder.hasErrors()) { System.err.println(kbuilder.getErrors().toString()); }

wrong class format Bulding a Package from Java 7 to Java 8

无人久伴 提交于 2019-12-24 11:35:03
问题 i have two installations of Guvnor 5.6.0.Final, one (Machine A) is runnig over Java 7, the second one (Machine B) is runnig over Java 8. I made an export of the repository from Machine A and imported into Machine B. Every time i do the Build Package i have this stack trace Sep 29, 2014 9:58:48 AM org.apache.catalina.core.ApplicationContext log SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract org.drools