[rules-users] Check all elements of a list (Drools Expert)

Wolfgang Laun wolfgang.laun at gmail.com
Thu Feb 24 12:06:46 EST 2011


You can count (using the accumulate function) all objects of SomeOtherType.
Then, you can count (again, using the accumulate function) all object of
SomeOtherType meeting all the constraints.

For better performance (if this is an issue) you might use the stepwise form
of accumulate, ultimately returning a compound object containing both
counts, or implement a custom accumulate function.

-W


2011/2/24 Petr Chelčický <petr.chelcicky at centrum.cz>

>
> Hi! I'm trying to write rules in Drools Expert. In the when part of the
> rule, I check some properties of an Application object. This object contains
> a List and I would like to check if a bunch of rules apply to all objects of
> SomeOtherType in this list. The rule should fire only when the constraints
> are valid for ALL objects in that list. How could this be done?
> _______________________________________________
> 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/20110224/2eb71e7e/attachment.html 


More information about the rules-users mailing list