<br>&nbsp;&nbsp; Rules are supposed to be declarative in nature. You should never need to add control statements, neither to the LHS (&quot;when&quot;), nor to the RHS (&quot;then&quot;), although, the RHS being a java code block allows you to do it... but it is usually code smell...
<br><br>&nbsp;&nbsp; Think about what you are doing and check if you are not trying to use drools as a scripting language... <br><br>&nbsp;&nbsp; Following may help:<br><br><a href="http://markproctor.blogspot.com/2007/03/writing-better-rules.html">
http://markproctor.blogspot.com/2007/03/writing-better-rules.html</a><br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br>&nbsp; <br><br><div><span class="gmail_quote">2007/5/23, Rajesh.Sachin10 &lt;<a href="mailto:rajesh_sachin10@yahoo.co.in">rajesh_sachin10@yahoo.co.in
</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>We can write the Java functions in [then] condition of the dsl file.<br>
<br>Is it possible to write JAVA functions / JAVA kind of coding in the [when]<br>condition of dsl file?<br><br><br>eg: [when] for(int i = 0; i &lt; 3; i++) {&nbsp;&nbsp;System.out.println(i);&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[then] Log &quot;{message}&quot;
<br>--<br>View this message in context: <a href="http://www.nabble.com/Writing-JAVA-functions-in--when--condition-of-the-dsl-file-tf3806720.html#a10773355">http://www.nabble.com/Writing-JAVA-functions-in--when--condition-of-the-dsl-file-tf3806720.html#a10773355
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli
<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>