Informations about the roadmap
by HERICHER Benoit DSIC SGSIC
Hi!
Are there any informations about the roadmap : what could we expect in
the next releases and when should they be available?
Regards
Benoit
14 years, 2 months
Orgnizing Rule sets
by Modha Khammammettu
Hi
I just started on drools. I am looking at rule files that some one wrote.
I see that rule files that I have thousands of lines of drools code. Is it
that all drools need to be dumped into one file. Is there a way that rules
can be organized into multiple drools files (just like classes in a java
package)
Any pointers are appreciated.
Thanks
MK
14 years, 2 months
Guvnor LHS and RHS questions
by Dean Whisnant
Hello,
I've only been working with Drools for a little over a month or so now and I've begun integrating it into my application via Eclipse and creating DRL files. The nature of this application is to take a data record from one file and create a new data record in another file. This is done in a batch of any number of records, depending on the number of records sent to us in the first file. To accomplish this I have two classes, one representing each file, and I create and object for each of them, inserting them into the knowledge session and then fire the rule.
ksession.insert(myObjectIn);
ksession.insert(myObjectOut);
ksession.fireAllRules();
The first object has around 1,000 fields and the second has 250, so my class structure is quite broad.
In a DRL file I have created the following rule:
rule "Primary Diagnosis Code"
when
$ccl : anObjectIn(IncomingDiag1 != null)
$cdl : anObjectOut()
then
$cdl.PrimaryDiag = $ccl.IncomingDiag1;
end
This rule fires great and the PrimaryDiag field in myObjectOut is updated with what iss in myObjectIn.IncomingDiag. I can then write the object back out the the database fine.
A requirement of my project is that I allow users (analysts) to create their own rules that are above and beyond those I might create in a .drl file. To do so we are looking to deploy Guvnor and let them use the Guided editor to create rules. I've already loaded my fact models into Guvnor and have them available in the drop down conditions.
The questions that are hitting me now are:
1) On the LHS when I've chosen the fiels IncomingDiag the only options I have for conditions are "equal to", "not equal to", "matches", and "sounds like". I don't see an option for null or notnull. If I were to choose "not equal to" I then have the options for Literal Values, New Formulas, or Expression Editor (which has none by default). I haven't seen any examples where someone is evaluating a field in Guvnor for being either "" or null. How would one accomplish this? The literal value does not allow you to leave it blank as in "" and if you type "" in it, the source shows """".
2) On the LHS, if I were to want to evaluate IncomingDiag1 == IncomingDiag2 I don't see a method except if I were to choose New Formula and type in the field name Incoming Diag2. Is there another way that they could be prompted for the field choises again?
3) On the RHS, when I go to add a new then, I'm prompted to choose only to either "insert fact anObjectIn" or to "logically insert fact anObjectIn" or to manually enter DRL logic. Both of the inserts appear to create logic that would create a new object with the data in it:
anObjectIn fact0 = new anObjectIn ();
fact0. IncomingDiag1 ( 11 );
insertLogical(fact0 );
But what I really want is something similar to my DRL from above. Am I missing something? Or would this have to be a case where they would manually enter the DRL statement?
Thank you!
Dean Whisnant
Senior Software Developer
basys, inc.
14 years, 2 months
List from collection -> bug?
by Evert Penninckx
The drools user guide contains this example:
when
$assessment : Assessment()
$p : Person()
$addresses : List() from $p.addresses
exists (Address( state == "NC") from $addresses)
then
modify ($assessment) {} #Modify assessment in a modify block
end
I derive from this that $addresses is a list. But when I add a
System.out.println($addresses.getClass().getName()) I get "Address" as
result
Also, when I want to use $addresses as a list in the consequence (eg.
.size() ), I get java.lang.IllegalArgumentException: object is not an
instance of declaring class.
Is this expected behaviour?
Evert
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/List-from-collection-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Looking for a place to start with drools
by Dean Whisnant
I am investigating using Drools for our company's EDI processing. The nature of our software system is that each of our clients (dozens) has a full distribution of our base software and in the past we would make custom changes to that base software at each of their sites based upon their trading partners and business needs. For the most part these changes involved nothing more than if-then statements for rather simple logic, but that would become complicated at certain customers where there were large numbers of trading partners and specific customer needs. In general we saw 2,000 lines of code swell to 4-6,000 lines of code.
We are in the process of rewriting this portion of our code and are entertaining using drools to allow us to 1) create a standard ruleset, 2) create a ruleset specific to a trading partner (many customers share some common trading partners), and 3) create a customer business ruleset that they can maintain through some GUI tool (Guvnor).
So far, I've created a sample java program that has classes representing some of our data files (UniData environment using uniobjects) and have been working with a single .drl file to test out general rules. I appear to be able to write just about any rule I've needed in the past with no issues, including rules that spawn processes within my native software.
These are my questions:
1. How would you package these types of rules? I have three categories as stated above and it seems logical that I would package them in that manner. However within each group there are logical groupings of rules. In the customer rules I may have a couple dozen on how to populate a field that deals with adding comments and another couple dozen having to deal with setting certain fields with specific codes that are based upon incoming data. Two quite different logical areas within our software.
2. How would you deal with the GUI? Is Guvnor truly something I can setup in a way that my end users can manipulate without "damaging" the custom ruelset?
3. Within Guvnor, how would you handle the possibility of there being over 2,000 fields to choose from to form a rule?
4. What is the performance hit if we were to make each customer rule part of once decision table or another? Would you even consider this as an option?
Thank you!
--Dean
14 years, 2 months
Rule id / Rule name
by Nadav Hashimshony
Hi,
I would like to return to the Fact object the rule id that was caught
my facts class has a memeber
String caughtRule;
and set and get
setCaughtRuleId (String s) { caughtRule= s;}
String getCaughtRuleId () {return caughtRule;}
my rule looks like:
rule "01"
salience 100
activation-group "mygrp"
no-loop true
when
d : CFactClass( someMember matches "some-string");
then
System.out.println("01 caught");
d.setCaughtRuleId("01");
d.setCaught();
end
when the rule is fired i see the the setCaught() worked (its a boolean
variable) but the setCaughtRuleId methids return empty string...
any ides?
Thanks
Nadav,.
14 years, 2 months
Memory usage tied to rule report?
by Jared Davis
Hi,
I'm attempting to track down an out of memory error.
I have ~400 rules that operate on ~10000 facts. One set of facts throws an
out of memory error while other sets process w/o an error. It is easy to
reproduce.
When the system runs out of memory there are about 22,000,000 ReteTuple
objects active.
I assume I have a bad rule producing a large cross product.
How do I find it?
Is there an audit tool that will let me tie ReteTuple back to a specific
rule?
Regards,
Jared Davis
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Memory-usage-tied-to-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Could not initialize class org.drools.rule.builder.dialect.java.JavaDialect
by Donald Leuschner
Ok, I have been struggling with this error for days now. I am getting a
NoClassDefFoundError: Could not initialize class
org.drools.rule.builder.dialect.java.JavaDialect error.
I understand that this is most likely a classpath problem but have done
almost everything to try and resolve it. I have the
drools-compiler-5.1.0.jar in my lib folder where all my other jars are
(which successfully work btw) and adding this jar there resolves a
packagebuilder error also.
Does anyone have any idea? The JavaDialect.class files are in the jar if I
open it with 7zip...so it's not like they are not there. I'm really at a
loss with this one now.
14 years, 2 months