drools

Compile drools guided decision table into rules

懵懂的女人 提交于 2019-12-06 20:05:46
问题 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

Drools accessing generated java files

久未见 提交于 2019-12-06 13:32:17
问题 I am executing Drools rule through Mockito test. The rule fails at run time reporting the error with a line number of a java file having some long arbitrary name. It seems that Drools generates java files on the fly and injects into JVM. But when I search those files on my disc I don't find any. Is there a way I could store them on my disc? 回答1: Got the solution: You can dump the Drools generated java files in two ways. 1) Through command line: -Ddrools.dump.dir="target/dumpDir" e.g. I use

业务规则校验DEMO(规则引擎Drools+工作流引擎Activiti 的实现)

做~自己de王妃 提交于 2019-12-06 12:49:59
根据业务需求,需要一些规则校验。 此篇使用规则引擎Drools结合工作流引擎Activiti来实现一个简单的规则校验。 activiti.cfg.xml配置: <property name="customPostDeployers"> <list> <bean class="org.activiti.engine.impl.rules.RulesDeployer" /> </list> </property> gradle配置: //Drools compile 'org.drools:knowledge-api:6.4.0.Final' compile 'org.drools:drools-compiler:6.4.0.Final' compile 'org.drools:drools-core:6.4.0.Final' compile 'org.mvel:mvel2:2.2.8.Final' 1.Activiti流程定义 2.创建Drools规则文件 LiumiRules.drl 3.用错误测试数据测试,校验不通过 4.用正确测试数据测试,校验通过 来源: oschina 链接: https://my.oschina.net/u/1386987/blog/740399

Access to Drools returned fact object in Java Code

早过忘川 提交于 2019-12-06 10:21:31
I have a drools rule created via the Guvnor console and the rule validates and inserts a fact into the working memory if conditions were met. The rule is: 1. | rule "EligibilityCheck001" 2. | dialect "mvel" 3. | when 4. | Eligibility( XXX== "XXX" , YYY== "YYY" , ZZZ== "ZZZ" , BBB == "BBB" ) 5. | then 6. | EligibilityInquiry fact0 = new EligibilityInquiry(); 7. | fact0.setServiceName( "ABCD" ); 8. | fact0.setMemberStatus( true ); 9. | insert(fact0 ); 10. | System.out.println( "Hello from Drools"); 11. | end Java code that executes the rule is as follows RuleAgent ruleAgent = RuleAgent

开源规则引擎 drools

眉间皱痕 提交于 2019-12-06 10:19:23
java语言开发的开源业务规则引擎 DROOLS(JBOSS RULES )具有一个易于访问企业策略、易于调整以及易于管理的开源业务规则引擎,符合业内标准,速度快、效率高。业务分析师或审核人员可以利用它轻松查看业务规则,从而检验是否已编码的规则执行了所需的业务规则。 用XML节点来规范If--Then句式和事实的定义,使引擎干起活来很舒服。 而使用Java,Groovy等原生语言来做判断和执行语句,让程序员很容易过渡、移植,学习曲线很低。 来源: https://www.cnblogs.com/softidea/p/11977097.html

org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict

妖精的绣舞 提交于 2019-12-06 08:22:05
问题 org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'drools:grid-node'. I'm getting this error when I add a grid-node and ksession to my spring xml. I did some searching and looks like it a classpath issue. What dependency am I missing here ? <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xmlns

drools programmatically generate a fact model

痴心易碎 提交于 2019-12-06 07:49:39
I need to generate an enormous fact model using an ontology external to drools. Now, I could certainly write a script/program to pull this off. My approach would be to generate a java bean for each ontology class which contains the appropriate fields, methods, and references to other java objects based on ontological relationships (probably in a map). My question is whether drools has a more elegant way to approach this problem. I figure it must be a common problem that the fact model is derivable from resource available outside of drools, so I'm wondering if maybe drools(or guvnor) has a

Drools Rule format for firing only once

Deadly 提交于 2019-12-06 07:28:07
I'm using the drools 6 engine. Suppose I have an account object that has a collection of sections and each section has a status flag that can be "GOOD" or "BAD". If I was to write the following: rule "Check if account has a good subsection" when $account : Account() SubSection (status == "GOOD") from $account.getSubSections() then insertLogical(new AccountIsGood($account)); end I would expect this to simply add the logical rule AccountIsGood($account) if atleast one section was good. However, it seems this does not simply check for one successful subsection and end the rule, but instead it

Spring-Drools Integration: Referenced file (kie-spring.xsd) contains errors

你。 提交于 2019-12-06 06:36:39
问题 I'm trying to use drools with Spring. Spring version 4.01 Drools/Kie version 6.0.1 My kie-context.xml has the following error (in Eclipse): Referenced file contains errors (http://drools.org/schema/kie-spring.xsd). For more information, right click on the message in the Problems View and select "Show Details..." kie-context.xml: (imported in applicationContext.xml) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org

Spring boot and drools integration

好久不见. 提交于 2019-12-06 05:45:52
问题 I'm trying to run drools 6.2.0.Final with Spring Boot 1.2.2.RELEASE. I configured drools as the documentation says. My kie-context.xml configuration file is where I keep the drools beans and looks like this: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:kie="http://drools.org/schema/kie-spring" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www