drools

Configure drools with spring. xsd errors

烈酒焚心 提交于 2019-12-06 04:47:43
I'm trying to create spring roo application with Drools. But I faced with errors in applicationContext.xml. Error: Multiple annotations found at this line: - Unable to locate Spring NamespaceHandler for element 'drools:execution-node' of schema namespace 'http://drools.org/schema/ drools-spring' - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'drools:execution-node'. this is a piece of applicationContext.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http

Out of memory error in drools

狂风中的少年 提交于 2019-12-05 20:29:37
I am using drools5.5 and creating knowledge bases with the required drls and decision tables to execute the rules. In that., when i try to load a decision table(which is a XLS that has nearly 20,000 lines) in knowledgeBuilder i am getting out of memory exception.I have used the following piece of code KnowledgeBuilder knowBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); knowBuilder.add(ResourceFactory.newFileResource(fileLocation),ResourceType.determineResourceType(fileLocation)); when i execute this., i am getting Java heap space error and permGen space error. Is there any other way

Convert Java POJO to Drools DRL and vice versa

与世无争的帅哥 提交于 2019-12-05 18:42:10
I have rule configuration on UI which builds to Java POJO. How could I generate Drools DRL (to be passed to other component which will match facts, etc and returns true or false if rule matches). Also I receive DRL file from database and in order to show rule on UI, I need to convert back to Java POJO. Basiclly is there any tool or script that could convert between Java POJO and Drools DRL file? If not, what is the best way available? Thanks much! I am not sure what are your Java POJOs? Are they representing Rules, Patterns, Constraints, etc? If so, Drools has an internal canonical model for

Java常用的规则引擎,让你变动的代码更加容易维护

丶灬走出姿态 提交于 2019-12-05 10:51:26
概述 在本文中,我们将介绍Java中一些最受欢迎的规则引擎。 规则引擎简介 规则引擎由推理引擎发展而来,是一种嵌入在应用程序中的组件,实现了将业务决策从应用程序代码中分离出来,并使用预定义的语义模块编写业务决策。接受数据输入,解释业务规则,并根据业务规则做出业务决策。在Java中,大多数流行的规则引擎都实现JSR94 将规则引擎想象成一个以数据和规则作为输入的系统。它将这些规则应用于数据,并根据规则定义为我们提供输出。让我们以一个在线购物为例,我们希望为客户提供某些促销或折扣。 如果购物车总额超过$ 400,可为客户提供20%的折扣。 第一次下单给10%。 上面将购物车和客户定义为满足规则集中定义的条件的规则将在其中执行的数据。 规则引擎的优点 简化系统架构,优化应用 提高系统的可维护性 减少编写“硬代码”业务规则的成本和风险 应付特殊状况,即客户一开始没有提到要将业务逻辑考虑在内 过将规则引擎分开,它提供了更大的可重用性。 规则引擎场景 流程分支非常复杂,规则变量庞大 有不确定性的需求,变更频率较高 需要快速做出响应和决策 规则变更期望脱离于开发人员,脱离coding Java 中常用的开源规则引擎有哪些呢? Drools Drools是业务规则管理系统(BRMS)解决方案。它提供了核心业务规则引擎(BRE),Web UI和规则管理应用程序(Drools Workbench)

Possible causes for “StreamCorruptedException: invalid stream header”

风格不统一 提交于 2019-12-05 05:43:05
I (try to) use drools to process my pricing rules. But when I try to execute the rules the following exception is thrown: java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:418) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109) at com.sapienter.jbilling.server.pluggableTask.PluggableTask.readKnowledgeBase(PluggableTask.java:115)

Error installing Drools plugin for Eclipse

一笑奈何 提交于 2019-12-05 04:47:23
Does anyone know how to fix this issue ? Cannot complete the install because one or more required items could not be found. Software being installed: JBoss Runtime Drools Detector 6.3.0.Final (org.jboss.tools.runtime.drools.detector.feature.feature.group 6.3.0.Final) Missing requirement: JBoss Runtime Drools Detector 6.3.0.Final (org.jboss.tools.runtime.drools.detector.feature.feature.group 6.3.0.Final) requires 'org.jboss.tools.runtime.core.feature.feature.group 0.0.0' but it could not be found You need to add http://download.jboss.org/jbosstools/updates/stable/luna/ update site into eclipse

what is the difference between no-loop and lock-on-active in drools

有些话、适合烂在心里 提交于 2019-12-05 04:13:04
Here is an example of a rule that uses "no-loop": rule "Even Number Rule" dialect "java" no-loop when n : Number( number !=0 && (number%2)==0 , value : number) then modify(n){setNumber(8)}; end Long story short: no-loop: avoid the re-activation of a rule caused by the RHS of that SAME rule. lock-on-active: avoid the re-activation of a rule NO MATTER what the cause is. Long story: http://ilesteban.wordpress.com/2012/11/16/about-drools-and-infinite-execution-loops/ Hope it helps, 来源: https://stackoverflow.com/questions/17042437/what-is-the-difference-between-no-loop-and-lock-on-active-in-drools

Can't run hello world on drools - dlr files are not picked from classpath by KieContainer

早过忘川 提交于 2019-12-05 02:37:02
问题 Following documentation: 6.1. The Basics I created a simple class Applicant which should be checked with drl file loaded from the class path by KieContainer. From the doc: " At this point it is possible to create a KieContainer that reads the files to be built, from the classpath. KieServices kieServices = KieServices.Factory.get(); KieContainer kContainer = kieServices.getKieClasspathContainer(); The above code snippet compiles all the DRL files found on the classpath and put the result of

Compile drools guided decision table into rules

点点圈 提交于 2019-12-05 01:32:50
I am wondering how I could use a guided decision table from the Drools Workbench inside a Java application using the drools runtime. The idea is that a user would work defining rules, processes and some decision tables in the workbench, which will be picked up by the drools runtime. Still, for some reason, I can't figure out how to execute this in drools, since it stored the table as a gdst file and it does not seem to compile to drools. With drools, is there a way to: - execute the gdst file as I would with an excel decision table? - or compile a gdst file in rules? I've been looking for a

Drools Rules Template - first invocation 1000 times slower than subsequence invocations

纵然是瞬间 提交于 2019-12-04 21:52:15
I have built a Drools Rules Template using Drools 6.4.0.Final It is pretty much identical to the example provided here . I have wrapped it in a Spring RestController and deployed it as a WAR in to Tomcat . I notice that the first call is always very slow to get a result and gets slower as the number of rows in the xls spreadsheet grows. I imagine drools builds an index when the first ever KieSession is created. And that this index is subsequently cached making further calls much faster? I see the same behaviour when invoking directly from unit tests. First test is slow and subsequent tests are