[rules-users] Difference between constraint within a pattern and eval

vdelbart delbart.v at mipih.fr
Thu Oct 25 10:58:21 EDT 2007


I try with this and it's working. I don't know why your case doesn't work.

public class Experience {
	private String primary;
	public String getPrimary() {
		return primary;
	}
	public void setPrimary(String primary)	{
		this.primary= primary;
	}
}

and rules :

rule "test1"
	dialect "mvel"
	when
		exp : Experience( eval(exp.getPrimary() == "SY") )
	then
		System.out.println("SY1");
end

rule "test2"
	dialect "mvel"
	when
		Experience( primary == "SY")
	then
		System.out.println("SY2");
end

And in my console, I have :
SY2
SY1

regards,

V.


-- 
View this message in context: http://www.nabble.com/Difference-between-constraint-within-a-pattern-and-eval-tf4688141.html#a13408653
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list