[rules-dev] Rule failes silently

Wolfgang Laun wolfgang.laun at gmail.com
Tue Feb 28 07:50:14 EST 2012


public class SimpleType {
    private String state;
    private int    count;
}

Insert facts  with count == 1 and 2 and 99 and 100. The following rule
compiles but does not fire:

rule "show +98"
when
    $st1: SimpleType($c1: count )
    $st2: SimpleType( count == $st1.count + 98 )  // use $c1 + 98 and rule fires
then
    System.out.println( "SimpleType: " + $st1.getCount() );
end

-W


More information about the rules-dev mailing list