Hi, Davide,<div><br></div><div>Here is how my rule looks like :</div><div><br></div><div>when</div><div> $item : Item(param1 != 0, param2 == 0, !(this instanceof SpecialItem))</div><div> $gsc : SomeBusinessLogic</div>
<div>then </div><div><span style> $gsc.doSomething($</span><a href="http://item.id/" target="_blank" style>item.id</a><span style>);</span><br style><div class="im" style> for (int i = 0; i < $item.quantity; i++) {<br>
$gsc.doSomethingElse($<a href="http://item.id/" target="_blank" style="color:rgb(17,85,204)">item.id</a>);<br> }<br> update($gsc);</div><div class="im" style>end</div><div class="im" style><br></div><div class="im" style>
The above snippet throws an error @ i < $item.quantity, and says 'no such identifier $item'...</div><div class="im" style>I can't figure out what might be causing this.</div><div class="im" style><br></div>
<div class="im" style>Thanks</div><br><div class="gmail_quote">On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara <span dir="ltr"><<a href="mailto:dsotty@gmail.com">dsotty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Did you remember to bind $item to some expression in the LHS ? Maybe you just<br>
called that "item" without the $ :)<br>
Davide<br>
<br>
(the original "modify" syntax is still wrong anyway)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block-problem-tp3648460p3648718.html" target="_blank">http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block-problem-tp3648460p3648718.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br></div>