<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Edson, Thanks so much for the reply. It makes
perfect sense to me. I really appreciate it. </blockquote><div> - Krishna <br>
</div><div class="gmail_quote"><br><div><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Krishna,<br>
<br>
The dialect configuration affects only semantic code blocks. I.e.,<br>
consequences, eval() blocks, etc.<br>
They are designed to be interchangeable. That is why the examples have<br>
rules using each of the dialects.<br>
<br>
It is mostly a matter of taste, but MVEL is a script language and as so<br>
has syntax sugar for nested object access, collections, maps, arrays etc...<br>
nothing more than that. Also, MVEL supports java syntax anyway. For<br>
instance, assuming you have a class:<br>
<br>
Person {<br>
Map<String, Address> addresses;<br>
// gets/sets<br>
}<br>
<br>
The following consequence should run just fine, both in java and MVEL:<br>
<br>
then<br>
$person.getAddresses().get("home").setStreetName("my street");<br>
end<br>
<br>
Although, MVEL allows you to use a cleaner syntax:<br>
<br>
then<br>
$person.addresses["home"].streetName = "my street";<br>
end<br>
<br>
It is mostly a matter of taste.<br>
<br>
[]s<br>
Edson<br>
<br>
2008/5/14 Krishna Satya <<a href="mailto:krishna.ksatya@gmail.com">krishna.ksatya@gmail.com</a>>:<br>
<br>
> Hi, I am trying to understand the difference in how drl rules are expressed<br>
> via the java or mvel dialects. Looking at the drools-examples it is not<br>
> exactly clear. I was looking at the PetStore.drl which seems to specify the<br>
> dialects for various rules using both java and mvel. Are there any<br>
> references to examples which showcase a rule that is expressed both through<br>
> java and mvel dialects so it is clear what the differences are. The rules<br>
> in the PetStore.drl which specify java or mvel syntactically seem to look<br>
> the same.<br>
><br>
> Also, are there any general suggestions as to when a rule author should use<br>
> the java or the mvel dialect.<br>
><br>
> Thanks.<br>
> - K<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
><br>
<br>
<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" target="_blank">www.jboss.com</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20080514/57a78c73/attachment-0001.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20080514/57a78c73/attachment-0001.html</a><br>
<br></blockquote></div><br>