[rules-users] Inconsistent rule firing on a boolean field.

Creighton Kirkendall ckirkendall at gmail.com
Mon Apr 2 11:11:40 EDT 2012


I have two rules below; the first fails to fire for all values of photo
(photo is a boolean field).  The second rule give the correct behavior when
photo is true and false.  I am new to drools and could be wrong but this
feels like a bug. Can anyone give me a reason for this behavior.


*BAD RULE:*
# rule values at C137, header at C132

rule "Photochromatic_137"
when
   RxOrderType(product[0].lens.material.photo == true,
 product[0].lens.design.lensType=="SV")
then
   addResult("e1",results);
   System.out.println("Single Vision-Photo");
end


*GOOD RULE (notice the - true &&):*
# rule values at C137, header at C132

rule "Photochromatic_137"
when
   RxOrderType(true && product[0].lens.material.photo == true,
 product[0].lens.design.lensType=="SV")
then
   addResult("e1",results);
   System.out.println("Single Vision-Photo");
end


Creighton Kirkendall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120402/682c8730/attachment.html 


More information about the rules-users mailing list