drools

Location of drools-spring.xsd on git hub (or reliable source)

岁酱吖の 提交于 2019-12-24 08:44:17
问题 My project depends on drools 5.6.0.Final version. As part of that I'm trying to find a uri that I can rely for the drools-spring.xsd file. I'm trying to locate a reliable URI for that file I can reference, so that eclipses doesn't show issues, and so that spring can also intercept the requests and replace with the files in the jar as it sees fit. I can drill into drools-spring-5.6.0.Final.jar in eclipse and see the xsd files in org.drools.container.spring . I also can see the xsd file here:

How to do date calculation in drools?

风格不统一 提交于 2019-12-24 06:36:22
问题 I'm newly to drools and got a confusion on date comparison in drl files. I got an condition that to compare two Date type facts. The drl is like : rule "TimeComparison" when $person:Person( date1 >= date2 ) then // end Inside, date1 is three days after a known date. How to achieve the (Three days/weeks/months after a specific date) in drl rule files? 回答1: Assuming your Date is java.util.Date, the < operator uses Date.before(date) and the > operator uses Date.after(date). I suggest using Date

stripped down drools guvnor

南楼画角 提交于 2019-12-24 05:29:34
问题 I need to integrate drools guvnor into my application but I think it is a bit overkill for my needs, I don't need an external application... I just need the editors nothing else. Are there a way to only use these without using the entire thing? I know I can use embedded mode, but I still have to have a full working guvnor instance installed and running what I am asking for is just a dependency or something without the whole thing.... Is there such a thing? Or do I have to strip it down

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

drools mvel for each element in a map

大城市里の小女人 提交于 2019-12-24 01:53:02
问题 One of the no-nos in drools includes manually iterating over collections in the consequence (then clause). I need to write a drool which is effectively iterating over a map while doing something for each key value pair in that map. In other words, I need to duplicate the behavior of a for-each loop in drools without actually writing a for-each loop. Now, I realize I could just write a for-each loop in the consequence. I want to keep my code as close to drools-standard as possible. I have

Drools - Resource does not have neither a source nor a target path

陌路散爱 提交于 2019-12-23 23:03:26
问题 I'm very new to Drools and adapted the Spring Boot configuration i found here to enable me to read a bunch of rules from a Database as String's instead of reading them from DRL Files in an application folder. When I startup my application using the code below i'm get the following exception using Spring Boot, Drools 6.5.Final, Java 1.8: Caused by: java.lang.RuntimeException: Resource does not have neither a source nor a target path. Impossible to add it to the bundle. Please set either the

How can we share individual rules between .drl files in JBoss Rules?

不羁的心 提交于 2019-12-23 17:14:54
问题 We are using JBoss Rules (a.k.a. Drools) and have several .drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one .drl file? Unfortunately, there does not seem to be any kind of include or module facility. 回答1: There is no way of including rules from another .drl file from within a .drl file. You can however add two .drl files to the same ruleBase and they will work as if they were in

Rules in jBPM 6

我的梦境 提交于 2019-12-23 04:13:18
问题 I have created a process in jbpm 6. There is a class Person, with attributes name and age. In the process form, the name and age of the person is entered. The first node in the process is a human task to view the details. The second node is an XOR gateway with drools expression on its arcs like Person(age > 20) and Person (age < 20). Now when I execute the process instance, the first human tasks works fine, but when it reaches the gateway, I can see this error - "XOR split could not find at

java code to access drools guvnor

随声附和 提交于 2019-12-23 04:05:01
问题 We have a project requirement to access the guvnor through a web application .Can any one let me know how to access guvnor through java code ? 回答1: The mortgage-example already has some example code. And the Drools Expert manual probably explains it in detail. Here's the code: private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeAgent kagent = KnowledgeAgentFactory .newKnowledgeAgent( "MortgageAgent" ); kagent.applyChangeSet( ResourceFactory .newClassPathResource(

Using JBoss DROOLS XMLDumper with .dslr file

北城以北 提交于 2019-12-23 03:32:18
问题 I have a .dslr file consiting of a rule(dslr) and a dsl file. I need to get the XML output of the DRL from this dslr. I've tried different ways with the XMLDumper but cannot get it to work. Any ideas? 回答1: First convert your DSLR file to DRL, then do the same as before. See following link for an example on how to convert DSLR to DRL: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/DrlParserTest.java 回答2: I repackaged the unit test