[rules-users] For loop inside a modify block problem

Mauricio Salatino salaboy at gmail.com
Tue Jan 10 13:47:03 EST 2012


You just need to do the loop outside the modify block and then just
update the object.
Cheers

2012/1/10 Martin A <wmlsub at gmail.com>:
> Hello, guys,
>
> I have the following snippet of a right side rule:
>
>
>         modify ($gsc) {
>             doSomething($item.id);
>
>             for (int i = 0; i < $item.quantity; i++) {
>                 doSomethingElse($item.id);
>             }
>         }
>
> which looks like is invalid syntax in some way, but it comes out with
> strange error report, such as '[Error: no such identifier: $item]'
>
> Would you please assist me on how to put that loop inside that modify block?
>
> Thank you and regards,
> Martin
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -




More information about the rules-users mailing list