Approach for loading the rules| How to use MultithreadEvaluationOption.YES
by Harshit Bapna
Hi All,
1. Is it a good idea to categorize rules, place each category of rules in a
different drl file and load the different drls in a same knowledge base ?
Approaches to loading of rules in the knowledge base:
1. Load different drl files in a single knowledge builder and add the
package to a single knowledge base.
2. Load each drl file in a new knowlegeBuilder and then add the package to a
single knowledge base.
3. Load different knowledge bases for different drl files.
IMO, 1 is better. (Since none of the examples are using multiple drl files
so I asked this question)
2. My drools usage is for rules that requires stateless sessions
I was thinking of using Sequential Rete. (
http://blog.athico.com/2007/07/sequential-rete.html)
Apart from the below two lines of code is there anything which should be
taken care of ?
KnowledgeBaseConfiguration kbaseConf =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
kbaseConf.setOption(SequentialOption.YES);//
http://blog.athico.com/2007/07/sequential-rete.html
// kbaseConf.setOption(MultithreadEvaluationOption.YES);
3. How to achieve Multi Threading in drools for stateless rules? Is there a
way where I can use the inbuilt parallelism (if it supports) ?
I found an option MultithreadEvaluationOption.YES in the knowledge base
configuration.
If any sample code or example for multi threaded usage of drools is
available it would be of good help..
--Harshit
15 years, 7 months
Using rule flow in Guvnor
by Dinesh kumar
Hi,
I am having an issue in implementing the rule flow in guvnor.
I created a simple rule flow using eclipse plug in.
http://drools-java-rules-engine.46999.n3.nabble.com/file/n1057004/rules.jpg
I checked the rule flow model in eclipse using the green tick mark and it
showed Drools flow model checked successfully. My .rf and .rfm files were
created.
But when I imported .rf file in my guvnor and build the package I am getting
the following error : Unable to parse xml
When i checked the server log, only this was printed :
(null: 1, 93): cvc-elt.1: Cannot find the declaration of element
'org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper'.
This is the source of the generated .rfm file
1
1
Start
1
ailmentreserves
2
AilmentReserves
1
benefitreserves
3
BenefitReserves
1
4
End
2
3
4
4
resistrationflow
RuleFlowTest
1.0
RuleFlow
HealthCareTest
Am I missing anything. Should the package name in the eclipse same as the
package I use in guvnor ?
I have only the rule flow file in Eclipse and remaining are written directly
in guvnor.
Any hint on this will be of great help.
Regards,
Dinesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Using-rule-flow-in-Gu...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
Upating drl file without restarting the application
by devyani.sapre@wipro.com
Hi
How to achieve dynamic updation of rule file
(rules-added/deleted/modified) without the need for the application to
be restarted so as to load the rule file? Is there any property that can
be set to achieve this or do I need to run a thread to continuously
monitor the rule file for any change?
Thanks
Devyani
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
15 years, 7 months
Script Task BUG????
by Yaniv Itzhaki
Hi,
I am experiencing a strange bug (or feature???). I added a script task
(name="A") in my main process which just running System.out.println("Script
A");
I also added another script task (name="B") in my sub-process which is
running System.out.println("Script B");
But, when I am running the process I get the following output:
Script B
Script B
I continued to test this issue and added another script
task (name="C") with System.out.println("Script C"); in another sub-process
and I get:
Script C
Script C
Script C
If I add the line for every script System.out.println("Script X
"+context.getNodeInstance().getNodeName()) I get the following:
Script C A
Script C B
Script C C
Is it normal? how come I have this behavior???
Yaniv
15 years, 7 months
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
15 years, 7 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
15 years, 7 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.
15 years, 7 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.
15 years, 7 months