<br> Rules are supposed to be declarative in nature. You should never need to add control statements, neither to the LHS ("when"), nor to the RHS ("then"), although, the RHS being a java code block allows you to do it... but it is usually code smell...
<br><br> Think about what you are doing and check if you are not trying to use drools as a scripting language... <br><br> 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> []s<br> Edson<br> <br><br><div><span class="gmail_quote">2007/5/23, Rajesh.Sachin10 <<a href="mailto:rajesh_sachin10@yahoo.co.in">rajesh_sachin10@yahoo.co.in
</a>>:</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 < 3; i++) { System.out.println(i); }<br> [then] Log "{message}"
<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> Edson Tirelli
<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>