It is your problem, which I&#39;ve reproduced.  And &quot;being broken&quot; sure means &quot;a bug&quot;.<br>-W<br><br><div class="gmail_quote">2012/1/12 Martin A <span dir="ltr">&lt;<a href="mailto:wmlsub@gmail.com">wmlsub@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, Wolfgang,<div><br></div><div>Looks like the same problem appears on my side... So is it a bug, or misuse of the MVEL syntax?</div>
<div><br></div><div>Best regards,</div><div>Martin</div><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">
On Thu, Jan 12, 2012 at 4:11 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Using 5.3.0 Final.<br>
<br>
The reported compilation problem (&quot;no such identifier: $item&quot;) occurs<br>
with dialect MVEL, which appears to be broken w.r.t. RHS code containing<br>
a &quot;for&quot; statement. Note: the error is not flagged for the preceding occurrrence<br>
of $item, in $<a href="http://item.id" target="_blank">item.id</a>.<br>
<br>
Different kind of errorscan  occur, depending on how the &quot;for&quot;<br>
statement is written,<br>
for example:<br>
   int h = 10; for( int i = 0; i &lt; h; i++) { ... }   ## Error: no such<br>
identifier: h<br>
<br>
Avoid dialect MVEL - using Java and getters works fine.<br>
<span><font color="#888888"><br>
-W<br>
</font></span><div><div><br>
<br>
On 11/01/2012, Martin A &lt;<a href="mailto:wmlsub@gmail.com" target="_blank">wmlsub@gmail.com</a>&gt; wrote:<br>
&gt; Hi, Davide,<br>
&gt;<br>
&gt; Here is how my rule looks like :<br>
&gt;<br>
&gt; when<br>
&gt;     $item : Item(param1 != 0, param2 == 0, !(this instanceof SpecialItem))<br>
&gt;     $gsc : SomeBusinessLogic<br>
&gt; then<br>
&gt;     $gsc.doSomething($<a href="http://item.id" target="_blank">item.id</a>);<br>
&gt;     for (int i = 0; i &lt; $item.quantity; i++) {<br>
&gt;         $gsc.doSomethingElse($<a href="http://item.id" target="_blank">item.id</a>);<br>
&gt;     }<br>
&gt;     update($gsc);<br>
&gt; end<br>
&gt;<br>
&gt; The above snippet throws an error @ i &lt; $item.quantity, and says &#39;no such<br>
&gt; identifier $item&#39;...<br>
&gt; I can&#39;t figure out what might be causing this.<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; On Tue, Jan 10, 2012 at 10:08 PM, Davide Sottara &lt;<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Did you remember to bind $item to some expression in the LHS ? Maybe you<br>
&gt;&gt; just<br>
&gt;&gt; called that &quot;item&quot; without the $ :)<br>
&gt;&gt; Davide<br>
&gt;&gt;<br>
&gt;&gt; (the original &quot;modify&quot; syntax is still wrong anyway)<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <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>


&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</div></div><br>_______________________________________________<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>
<br></blockquote></div><br>