Drools 4 performs slower then Drools 3 - Help on .drl file adaptation
by Maxim Veksler
Hello everyone,
Please allow me to briefly describe how our system works:
We use drools as an efficient matching layers - I have X rules, in the RHS
of each rule I have a mark for each rule to signal that it has passed in the
current context (There are by definition more then 1 contexts). After the
first fireAllRules() has finished, and I have the data structure that allows
me to query what rules have passed for each context I assert a "Marker"
object, that allows Drools to continue filtering only for these contexts
that I decide as valid to match attempts.
The end result, is that I have 2 fireAllRules called with some java code in
between them.
In drools3 for 3 contexts I got the following resutls :
== Drools Section (Generic Call) : With default context settings, no
HotSpot.
RESULT:::::::: avg: 33.9023(ms) for 1555 calls
Now in drools4 I'm getting the following:
== Drools Section (Generic Call) : With default context settings, no HotSpot
- Drools 4
RESULT:::::::: avg: 37.4356(ms) for 1467 calls
As I increase the context's number I'm getting larger difference in results
time.
Please note that HotSpot is disabled just for the test, to not JIT
interference.
I've disabled all evals in the drl files, to all is left is pure Drools
syntax and yet It seems that the system works slower.
Please suggest what else I should be doing to optimize the drl files to work
efficiently with Drools 4 engine.
Thank you,
Maxim.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years
Re: [rules-users] Ruleflow "OR" Split Nodes
by ringsah@comcast.net
Kris,
Thanks for your response and attention to the matter. I really like the Drools ruleflow feature, and I think a resolution to this issue would make it more useful. Even if it is the more simple matching OR-split - OR-join constructs, I think that would go a long way.
Thanks Again,
-Hans
-------------- Original message --------------
From: "Kris Verlaenen" <kris.verlaenen(a)cs.kuleuven.be>
Hans,
The behaviour you are witnessing is indeed expected behaviour. The problem is that we currently do not have a matching OR-join construct, so it is indeed difficult to model behaviour like you want to. The reason is that is it a very difficult problem to create a generic OR join, i.e. a join that waits until all incoming connections either have been completed or were not triggered. In the example you are using it would still be pretty straighforward, however it becomes very difficult if you take random splitting and joining after the or-join into account, incomplete or joins and even unstructured looping.
I will add a n-of-m join type, meaning the join will wait until n of its incoming connections has been triggered. Since this n could be read from a variable, it allows you to do any kind of complex joining, but the process designer should make sure to update the n variable itself so it matches the correct number of incoming connections to wait for.
An alternative would be to provide matching OR-split - OR-join constructs, as those aren't difficult to support either, but not quite as powerful (we do implement this in our BPEL prototype but there it is much easier as BPEL is a structured process language).
You could also replace your OR construct by an XOR followed by AND splits, but that would probably make the process a lot more difficult to read.
Kris
----- Original Message -----
From: ringsah(a)comcast.net
To: rules-users(a)lists.jboss.org
Sent: Wednesday, November 19, 2008 3:59 PM
Subject: [rules-users] Ruleflow "OR" Split Nodes
I am having a problem with the ruleflow in Drools 4.0.7. I have the following simple ruleflow with a split node with a type of "OR" with two outgoing connections, each going to a different ruleflow group (image of ruleflow attached).
The problem I am having is with the join node, into which the two ruleflow groups connect back in. If I use a join node type of "AND", then it works okay unless only one branch is executed. Then the action, which simply prints "Action node" to the console, never gets executed.
If I use a join node type of "XOR", then it works okay unless both branches are executed. Then it appears that both branches are executed, because the action get executed twice. However, the rules from the ruleflow group in only one of the branches end up getting fired.
I have attached a zip file containing an extremely simple eclipse test project that illustrates the problem.
Thanks in Advance,
-Hans
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years
Ruleflow "OR" Split Nodes
by ringsah@comcast.net
I am having a problem with the ruleflow in Drools 4.0.7. I have the following simple ruleflow with a split node with a type of "OR" with two outgoing connections, each going to a different ruleflow group (image of ruleflow attached).
The problem I am having is with the join node, into which the two ruleflow groups connect back in. If I use a join node type of "AND", then it works okay unless only one branch is executed. Then the action, which simply prints "Action node" to the console, never gets executed.
If I use a join node type of "XOR", then it works okay unless both branches are executed. Then it appears that both branches are executed, because the action get executed twice. However, the rules from the ruleflow group in only one of the branches end up getting fired.
I have attached a zip file containing an extremely simple eclipse test project that illustrates the problem.
Thanks in Advance,
-Hans
16 years
Firing Rules Before Fact Insertion - Design Questions
by keithnielsen
I am trying to accomplish a couple of things:
1) I want to fire all rules and then have the rules constantly being
evaluated as facts are created,updated, and deleted, i.e. there are
situations where its not feasible to have all the facts inserted upfront
before firing all rules.
2) Once a rule has fired once, I want for it to be able to fire again when
the application inserts facts that warrant it. I understand the no-loop
construct but these would be facts inserted by the application and not
necessarily by other rules. I don't want to always have to refire the rules
via session.fireAllRules
Any ideas whether this is feasible/advisable?
--
View this message in context: http://www.nabble.com/Firing-Rules-Before-Fact-Insertion---Design-Questio...
Sent from the drools - user mailing list archive at Nabble.com.
16 years
RETURNED MAIL: DATA FORMAT ERROR
by The Post Office
The original message was received at Wed, 19 Nov 2008 13:40:14 +0700
from lists.jboss.org [176.133.144.96]
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
----- Transcript of the session follows -----
... while talking to 59.175.180.236:
>>> MAIL From:"The Post Office" <postmaster(a)lists.jboss.org>
<<< 500 Refused
16 years
Will Drools 4.0.7 BRMS work with JackRabbit 1.4?
by seemamani
I understand that Drools 4.0.7 internally uses JackRabbit 1.3. However this
version of Jackrabbit is old and has many issues such as in the case of
clustering. The Jackrabbit mailing list has suggested using the new 1.4
version in which many bugs have been fixed. If I simply replace the
JackRabbit jars in BRMS with the new version and use the new schema for
repository.xml, will it work fine? Or is waiting for the Drools 5 version
the only option for me?
Thanks,
Seema
--
View this message in context: http://www.nabble.com/Will-Drools-4.0.7-BRMS-work-with-JackRabbit-1.4--tp...
Sent from the drools - user mailing list archive at Nabble.com.
16 years
Re: [rules-users] Ruleflow "OR" Split Nodes
by ringsah@comcast.net
To make it easier to follow, I have included the rules as well as some images in the message body. Here are the rules:
rule "Fact A Branch"
ruleflow-group "Fact A Branch"
when
FactA()
then
System.out.println("Fact A Branch");
end
rule "Fact B Branch"
ruleflow-group "Fact B Branch"
when
FactB()
then
System.out.println("Fact B Branch");
end
Here is a picture of the ruleflow:
Here is a picture of the rules trace when only FactA is inserted, and the join node is type "AND" - notice the ruleflow is never completed (also, when the ruleflow is run, the Action node is never executed):
Here is a picture of the rules trace when both FactA and FactB are inserted, and the join node is type "XOR" - notice the Fact A Branch rule activation is never executed:
TIA,
-Hans
-------------- Original message --------------
From: ringsah(a)comcast.net
I am having a problem with the ruleflow in Drools 4.0.7. I have the following simple ruleflow with a split node with a type of "OR" with two outgoing connections, each going to a different ruleflow group (image of ruleflow attached).
The problem I am having is with the join node, into which the two ruleflow groups connect back in. If I use a join node type of "AND", then it works okay unless only one branch is executed. Then the action, which simply prints "Action node" to the console, never gets executed.
If I use a join node type of "XOR", then it works okay unless both branches are executed. Then it appears that both branches are executed, because the action get executed twice. However, the rules from the ruleflow group in only one of the branches end up getting fired.
I have attached a zip file containing an extremely simple eclipse test project that illustrates the problem.
Thanks in Advance,
-Hans
16 years
What's wrong with the connectives?
by vanshi
Hi all,
Can somebody help me here?? I've a business rule presented in bold here that
I've put in the DRL file in the simplest form but compilation of rule is
generating this error "line 6:342 required (...)+ loop did not match
anything at character ' '"
And any set of value is getting evaluated to TRUE.....that means rule
validation is not happening.....I understand that I can use helper function
in java classes and call them in the rule but wanted to know how can I do
the same entirely in DRL file OR what's wrong with this. I've spent entire
day to figure out but completely clueless and afraid to try function
approach due to project deadline. Plz help.
pers: Person(sourceType == 'Insurance' && (age != null && > 17) &&
((cholesterol !=null && >= 200) || (hdlCholesterol !=null && < 60) ||
(cholesterolToHdlRation !=null && > 4.5) ||
(ldlCholesterol !=null && >160) || (vldl !=null && > 40) ||
(triglyceride !=null && > 50) || (glucose !=null && >130) || (bmi !=null
&& >=25) ||
(bodyFat > 0. 25 && sbjGdrCd !=null && == 'F' && age !=null && > 17
&& < 40) ||
(bodyFat > 0.30 && sbjGdrCd !=null && == 'F' && age !=null && > 39 && <
60) ||
(bodyFat > 0.31) && sbjGdrCd !=null && == 'F' && age !=null && age > 60)
||
(bodyFat > 0.19 && sbjGdrCd !=null && == 'M' && age !=null && >17 && <
40) ||
(bodyFat > 0.23 && sbjGdrCd !=null && == 'M' && age !=null && age > 39 <
60) ||
(bodyFat > 0.24 && sbjGdrCd !=null && == 'M' && age !=null && >=60)))
//Age>=18 AND Total Cholesterol >=200 OR HDL <60 OR Cholesterol Ratio
>4.5 OR LDL >160 OR VLDL >40 OR Triglycerides >150 OR Glucose >130 OR BMI
>=25 OR Body Fat % greater than the range of 14% and 25% when gender = F
and age between or equal to 18 and 39 OR Body Fate % greater than the range
of 18% and 30% when gender = F and age between or equal to 40 and 59 OR
Body Fat % greater than the range of 21% and 31% when gender = F and age
>60 OR Body Fat % greater than the range of 7% and 19% when gender = M and
age between or equal to 18 and 39 OR Body Fat % greater than the range of
14% and 23% when gender = M and age between or equal to 40 and 59 OR Body
Fat % greater than the range of 15% and 24% when gender = M and age >60
--
View this message in context: http://www.nabble.com/What%27s-wrong-with-the-connectives--tp20571531p205...
Sent from the drools - user mailing list archive at Nabble.com.
16 years
Ruleflow "OR" Split Nodes
by ringsah@comcast.net
I am having a problem with the ruleflow in Drools 4.0.7. I have the following simple ruleflow with a split node with a type of "OR" with two outgoing connections, each going to a different ruleflow group (image of ruleflow attached).
The problem I am having is with the join node, into which the two ruleflow groups connect back in. If I use a join node type of "AND", then it works okay unless only one branch is executed. Then the action, which simply prints "Action node" to the console, never gets executed.
If I use a join node type of "XOR", then it works okay unless both branches are executed. Then it appears that both branches are executed, because the action get executed twice. However, the rules from the ruleflow group in only one of the branches end up getting fired.
I have attached a zip file containing an extremely simple eclipse test project that illustrates the problem.
Thanks in Advance,
-Hans
16 years
drools performance : max limit on # of facts for each execution
by techy
If I have set of rules(say 5 rules for now.. which just compares few fields
in facts and increments execution count on Rule Object as a consequence)
working on single fact and I have huge amount of data to process,
How many maximum facts can I insert into stateless session at a time for
faster execution of rules for each execution?
I inserted to 50,000 facts into stateless session(desktop runs in win XP,
and assigned 500MB head size to the java process) and with drools debug
enabled, I noticed that insertion itself takes(>10 secs) considerable time.
I would like to know best practices in such situations. appreciate your
help.
Thanks!
--
View this message in context: http://www.nabble.com/drools-performance-%3A-max-limit-on---of-facts-for-...
Sent from the drools - user mailing list archive at Nabble.com.
16 years