I cannot reproduce your findings.<br>Which bmi values cause the firing of two rules?<br>Are you using exactly the same .drl file Greg sent?<br>-W<br><br><div class="gmail_quote">2009/5/4 Femke De Backere <span dir="ltr"><<a href="mailto:femmyke@gmail.com" target="_blank">femmyke@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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.<br>
<br>
Thx,<br><font color="#888888">
<br>
Femke<br>
</font><br><br>
<br>
<br>
Op 4-mei-09, om 02:47 heeft Greg Barton het volgende geschreven:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Try the attached code.<br>
<br>
--- On Sun, 5/3/09, Femke De Backere <<a href="mailto:femmyke@gmail.com" target="_blank">femmyke@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
From: Femke De Backere <<a href="mailto:femmyke@gmail.com" target="_blank">femmyke@gmail.com</a>><br>
Subject: Re: [rules-users] Rule problem<br>
To: "Rules Users List" <<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>><br>
Date: Sunday, May 3, 2009, 6:18 PM<br>
Thx for the answer. I tried this but I doesn't seem to<br>
work. For a BMI of 20, i get the result<br>
"ondergewicht", and it should be<br>
"normal".<br>
<br>
Op 4-mei-09, om 01:04 heeft Ingomar Otter het volgende<br>
geschreven:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Femke,<br>
The "Overgewicht| rule matches for _two_ BMIClass<br>
</blockquote>
facts, one with bmi >- 25 and one for BMIClass <30.<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you want to apply multiple constraints to a single<br>
</blockquote>
fact you have to list them as such:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
rule "Overgewicht"<br>
when<br>
bmiClass : BMIClass(bmi >= 25 && bmi<br>
</blockquote></blockquote>
<30)<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
then<br>
System.out.println("U heeft<br>
</blockquote></blockquote>
overgewicht");<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end<br>
</blockquote>
<br>
<br>
Cheers,<br>
Ingomar<br>
<br>
<br>
Am 04.05.2009 um 00:48 schrieb Femke De Backere:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
<br>
I want to make en BMI rule application, so I need<br>
</blockquote></blockquote>
to test the BMI values. But in rule "Overgewicht"<br>
and "Normaal", I need to use an AND, but it<br>
doesn't seem to work in any way I tried.<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Does anybody see the problem? The rest of the<br>
</blockquote></blockquote>
application is based on de sample project (created when<br>
making a new Drools project).<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thx,<br>
<br>
Femke<br>
<br>
package bmi<br>
<br>
import bmi.DroolsTest.BMIClass;<br>
<br>
rule "Overgewicht"<br>
when<br>
bmiClass : BMIClass(bmi >= 25)<br>
bmiClass : BMIClass(bmi < 30)<br>
then<br>
System.out.println("U heeft<br>
</blockquote></blockquote>
overgewicht");<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end<br>
<br>
rule "Obesitas"<br>
when<br>
bmiClass : BMIClass($bmi : bmi >= 30)<br>
then<br>
System.out.println("U heeft<br>
</blockquote></blockquote>
obesitas");<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end <br>
<br>
rule "Ondergewicht"<br>
when<br>
bmiClass : BMIClass($bmi : bmi < 18.5)<br>
then<br>
System.out.println("U heeft<br>
</blockquote></blockquote>
ondergewicht");<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end <br>
<br>
rule "Normaal"<br>
when<br>
bmiClass : BMIClass(bmi >= 18.5)<br>
bmiClass : BMIClass(bmi < 25)<br>
then<br>
System.out.println("U heeft een normaal<br>
</blockquote></blockquote>
gewicht");<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
</blockquote></blockquote>
end _______________________________________________<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<br>
</blockquote></blockquote>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
<br>
<br>
<<br>
DroolsTest<br>
.java><Sample.drl>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
<br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>