<br> Eval's are indeed less performatic than any other type of constraints. "inline-evals" are not as bad, but are also heavier than regular constraints. <br> The recommendation is to avoid when possible, but for some cases it is not possible.
<br><br> If you are using MR3 or later, you can use MVELs syntax in your constraints:<br><br>when<br> MyClass( aMapAttribute['aKey'] == "some Value" )<br>then<br> ...<br>end<br><br> The above will transparently be translated to an inline-eval, but that is the best you can do when working with maps.
<br><br> []s<br> Edson<br><br><br><div><span class="gmail_quote">2007/7/2, Rajesh_Kumar <<a href="mailto:Rajesh_Kumar@rsystems.com">Rajesh_Kumar@rsystems.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I want to use "eval" in my rules, but in rule writing guidelines Mark<br>has<br>Written that "Eval is Evil".<br><br>I want to compare the values of Hash Map in my when (conditions) part.
<br><br>1) Will anyone suggest something so that I can compare Hash Map keys in<br>when part?<br><br>2) Does is there any performance related issue related to "eval";<br><br>Regards<br><br>Rajesh<br><br>--<br>This message has been scanned for viruses and
<br>dangerous content by MailScanner, and is<br>believed to be clean.<br><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>