[rules-users] question about 'from'

Sam mgop22 at gmail.com
Mon Mar 12 18:11:11 EDT 2007


When using the new 'from' feature, does Drools handle null values correctly? 
For example, let's say I have a rule like this:

rule check
  when
    Integer() from helper.getId();
  then
    ...
end

I tried returning null from getId(), but it caused Drools to throw an exception.
 So what I'm currently doing is have getId() return a collection, which may be
empty.  In this case Drools handles it without problem.  Is there a better way
to do this?  I just don't want to wrap everything in a collection.

thanks.

sam




More information about the rules-users mailing list