[rules-users] Are there second-rate fact types?

Wolfgang Laun wolfgang.laun at gmail.com
Tue Jun 10 08:26:32 EDT 2014


Consider:

   class Foo { /*...*/ }

   rule checkFoo
   when
      Foo( noSuchField > 0 )
   then ... end

DRL compilation reports an error (Error: unable to resolve method ...)
and identifies rule, line and column, which is fine.

Now let's look at:

   import java.util.ArrayList;
   rule checkArrayList
   when
      ArrayList( noSuchField > 0 )
   then ... end

The same DRL compiler (checked with 5.5.0 and 6.0.0) accepts this, and
there is a nasty exception thrown at runtime. This is inconvenient,
since the exception can be thrown by any code inserting an ArrayList
object, and the faulty rule isn't identified.

Why are certain classes second-rate?

-W


More information about the rules-users mailing list