[rules-users] Rule problem

Femke De Backere femmyke at gmail.com
Sun May 3 18:48:42 EDT 2009


Hi!

I want to make en BMI rule application, so I need to test the BMI  
values. But in rule "Overgewicht" and "Normaal", I need to use an AND,  
but it doesn't seem to work in any way I tried.

Does anybody see the problem? The rest of the application is based on  
de sample project (created when making a new Drools project).

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 overgewicht");
end

rule "Obesitas"
	when
		bmiClass : BMIClass($bmi : bmi >= 30)
	then
		System.out.println("U heeft obesitas");
end		
		
rule "Ondergewicht"
	when
		bmiClass : BMIClass($bmi : bmi < 18.5)
	then
		System.out.println("U heeft ondergewicht");
end	
		
rule "Normaal"
	when
		bmiClass : BMIClass(bmi >= 18.5)
		bmiClass : BMIClass(bmi < 25)
	then
		System.out.println("U heeft een normaal gewicht");
end		
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090504/b9317794/attachment.html 


More information about the rules-users mailing list