2010/2/24 Ansgar Konermann <ansgar.konermann(a)googlemail.com>:
rule "Issue error message if items preventing discount exist"
when
exists( ItemPreventingDiscount( $reason: reason, $item: item ) )
The exists isn't correct here; it prevents binding for $reason and
$item used on the RHS.
then
System.out.println("Discount not allowed: Item '"+
$item.getDescription()
+ "' prevents discount because " + $reason + ".");
Probably should use a retract on the ItemPreventingDiscount here.
Creating these XPreventingY facts would really make sense if they are
later combined into a single error report against the Order.
-W
end