I cannot reproduce your findings.
Which bmi values cause the firing of two rules?
Are you using exactly the same .drl file Greg sent?
-W
Thanks for the answer! But I sometimes get 2 rules that are correct, and that is impossible. I embedded Greg's DroolsTest class in my class (I am doing some test on performance and studying the difference between performance with a plain java class), and it still doesn't work, and I really don't see why. Anyone any suggestions, in attachement, my class.
Thx,
Femke
Op 4-mei-09, om 02:47 heeft Greg Barton het volgende geschreven:
Try the attached code.
--- On Sun, 5/3/09, Femke De Backere <femmyke@gmail.com> wrote:
From: Femke De Backere <femmyke@gmail.com>
Subject: Re: [rules-users] Rule problem
To: "Rules Users List" <rules-users@lists.jboss.org>
Date: Sunday, May 3, 2009, 6:18 PM
Thx for the answer. I tried this but I doesn't seem to
work. For a BMI of 20, i get the result
"ondergewicht", and it should be
"normal".
Op 4-mei-09, om 01:04 heeft Ingomar Otter het volgende
geschreven:
Femke,facts, one with bmi >- 25 and one for BMIClass <30.
The "Overgewicht| rule matches for _two_ BMIClass
If you want to apply multiple constraints to a singlefact you have to list them as such:
<30)
rule "Overgewicht"
when
bmiClass : BMIClass(bmi >= 25 && bmi
overgewicht");then
System.out.println("U heeft
to test the BMI values. But in rule "Overgewicht"end
Cheers,
Ingomar
Am 04.05.2009 um 00:48 schrieb Femke De Backere:
Hi!
I want to make en BMI rule application, so I need
and "Normaal", I need to use an AND, but it
doesn't seem to work in any way I tried.
application is based on de sample project (created when
Does anybody see the problem? The rest of the
making a new Drools project).
overgewicht");
Thx,
Femke
package bmi
import bmi.DroolsTest.BMIClass;
rule "Overgewicht"
when
bmiClass : BMIClass(bmi >= 25)
bmiClass : BMIClass(bmi < 30)
then
System.out.println("U heeft
obesitas");end
rule "Obesitas"
when
bmiClass : BMIClass($bmi : bmi >= 30)
then
System.out.println("U heeft
ondergewicht");end
rule "Ondergewicht"
when
bmiClass : BMIClass($bmi : bmi < 18.5)
then
System.out.println("U heeft
gewicht");end
rule "Normaal"
when
bmiClass : BMIClass(bmi >= 18.5)
bmiClass : BMIClass(bmi < 25)
then
System.out.println("U heeft een normaal
end _______________________________________________
https://lists.jboss.org/mailman/listinfo/rules-usersrules-users mailing list
rules-users@lists.jboss.org
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
<
DroolsTest
.java><Sample.drl>_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users