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