This works:

rule "test"
when
##    exists (MyClass());  ## this is redundant
    $l : ArrayList() from collect (MyClass (attribute == false));
    $r : AnotherClass();
then
    $r.doSomething( $l );
    for(Object o : new ArrayList( $l )) {
        modify((MyClass)o) { setAttribute(true); } ;
    }
end

-W




On 31 August 2011 12:18, chocksmith <rodrigo.goncalves@coffeebeantech.com> wrote:
I doesn't even compile. As o2 did not come from the LHS, I get the follow
error:
 The method setAttribute(boolean) is undefined for the type Object



--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Bulk-modification-tp3297162p3297952.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users