<br>&nbsp;&nbsp; Krishna,<br><br>&nbsp;&nbsp; The dialect configuration affects only semantic code blocks. I.e., consequences, eval() blocks, etc.<br>&nbsp;&nbsp; They are designed to be interchangeable. That is why the examples have rules using each of the dialects.<br>
<br>&nbsp;&nbsp; It is mostly a matter of taste, but MVEL is a script language and as so has syntax sugar for nested object access, collections, maps, arrays etc... nothing more than that. Also, MVEL supports java syntax anyway. For instance, assuming you have a class:<br>
<br>&nbsp;&nbsp; Person { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map&lt;String, Address&gt; addresses;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // gets/sets<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp; The following consequence should run just fine, both in java and MVEL:<br><br>then<br>&nbsp;&nbsp;&nbsp; $person.getAddresses().get(&quot;home&quot;).setStreetName(&quot;my street&quot;);<br>
end<br><br>&nbsp;&nbsp; Although, MVEL allows you to use a cleaner syntax:<br><br>then<br>&nbsp;&nbsp;&nbsp; $person.addresses[&quot;home&quot;].streetName = &quot;my street&quot;;<br>end<br><br>&nbsp;&nbsp; It is mostly a matter of taste.<br><br>&nbsp;&nbsp; []s<br>
&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/5/14 Krishna Satya &lt;<a href="mailto:krishna.ksatya@gmail.com">krishna.ksatya@gmail.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, I am trying to understand the difference in how drl rules are expressed via the java or mvel dialects.&nbsp; Looking at the drools-examples it is not exactly clear.&nbsp; I was looking at the PetStore.drl which seems to specify the dialects for various rules using both java and mvel.&nbsp; Are there any references to examples which showcase a rule that is expressed both through java and mvel dialects so it is clear what the differences are.&nbsp; The rules in the PetStore.drl which specify java or mvel syntactically seem to look the same.<br>

<br>Also, are there any general suggestions as to when a rule author should use the java or the mvel dialect.<br><br>Thanks.<br><font color="#888888">- K<br><br>
</font><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><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<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>