[rules-users] having trouble using accumulate to create a list of non null objects

Wolfgang Laun wolfgang.laun at gmail.com
Wed May 1 09:45:27 EDT 2013


Definitely a bug - please raise a JIRA with the trimmings.
-W


On 1 May 2013 15:18, burmanator <alexburman at gmail.com> wrote:

> I have 2 objects, Foo and Bar. Foo can store an instance of Bar. I am
> trying
> to create a list of all the Bar objects that correspond to all the Foo
> objects with a given name.
>
> the line in my rule I am using is:
>
> Foo($name : Name)
>
> $list : List() from accumulate( Foo( Name == $name, $b : Bar != null),
> collectList($b))
>
> Yet when I print out the list, it includes null elements. But if I instead
> make the rule:
>
> $list : List() from accumulate( Foo( Name == $name, $b : Bar != null),
> collectList($b!=null))
>
> I get false for all the null Bar objects.
>
> Am I missing something?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/having-trouble-using-accumulate-to-create-a-list-of-non-null-objects-tp4023606.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130501/ada14dd5/attachment.html 


More information about the rules-users mailing list