[rules-users] Class test fails (!= same as ==)

Wolfgang Laun wolfgang.laun at gmail.com
Tue Mar 13 03:05:36 EDT 2012


This has been fixed someplace on the way to 5.4.0 - it works correctly
in 5.4.0.Beta2
-W

On 12/03/2012, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
> Using 5.3.0.Final, arbitrary facts and the rule shown below:
>
> import org.drools.reteoo.InitialFactImpl
>
> rule "Clear" when
>     $f: Object()  #######
> then
>     if( ! ($f instanceof InitialFactImpl) ){
>       System.out.println( "retract a " + $f.getClass() );
>       retract( $f );
>     }
> end
>
> This retracts my Foo, Bar and Counter facts. Good.
>
>     $f: Object( class == Foo.class )  ####### changed
>
> This retracts all of my Foo facts. Excellent.
>
>     $f: Object( class != Foo.class )  ####### changed again
>
> This retracts only Foo facts. Bad.
>
> -W
>



More information about the rules-users mailing list