<br>&nbsp;&nbsp; Felipe,<br><br>&nbsp;&nbsp; May I ask you please to open a JIRA for that? we will look into adding it in the future.<br>&nbsp;&nbsp; The other request already has a JIRA for it.<br><br>&nbsp;&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">
2007/8/21, Felipe Piccolini &lt;<a href="mailto:felipe.piccolini@bluesoft.cl">felipe.piccolini@bluesoft.cl</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;">
<div style=""><div style="margin: 0px;">Edson,</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">&nbsp;What about sugar to be able to write DSLs dor this:</div><div style="margin: 0px;">&nbsp; &nbsp;DLS:&nbsp;
</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;A Person</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;- having age equals to 10</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;- or equals to 15</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;- or greather than 20
</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">&nbsp; DRL:</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp;p: Person( age == 10</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|| == 15</div><div style="margin: 0px;">
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;|| &gt; 20)</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">Right now, the &quot; - &lt;expression&gt;&quot;&nbsp; put a &#39;comma&#39; at the end of the line making this:</div>
<div style="margin: 0px;">&nbsp; &nbsp; &nbsp;p: Person( age == 10,&nbsp;|| == 15,&nbsp;|| &gt; 20)</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">What throws errors...</div><div style="margin: 0px; min-height: 14px;">
<br></div><div style="margin: 0px;">&nbsp; Is it possible to do that? I love the || == &lt;value&gt; thing in each line...</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">Thanks.</div><div>
<span class="e" id="q_1148a5da211c62a2_1"><br><div><div>On 21-08-2007, at 16:14, Saleem Lakhani wrote:</div><br><blockquote type="cite"> <div><p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">
Thanks </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Edson. That helped. One more thing, can't we execute something simple like: ObjectA</span></font><font color="black" face="Courier New" size="2">
<span style="font-size: 10pt;" color="">(units != families)</span></font></p><p><font color="black" face="Courier New" size="2"><span style="font-size: 10pt;" color="">When both units &amp; families are defined as int in ObjectA with their public get and set methods. This is the exception I am receiving.
</span></font></p><div><font color="black" face="Courier New" size="2"><span style="font-size: 10pt;" color="">&nbsp;</span></font><br></div><p><font color="red" face="Courier New" size="2"><span style="font-size: 10pt;" color="">
org.drools.rule.InvalidRulePackage: Unable to return Declaration for identifier &#39;families&#39; : [Rule name=Rule6, agendaGroup=Rating, salience=0, no-loop=false]</span></font><font color="black" face="Courier New" size="2">
<span style="font-size: 10pt;" color=""> Its even showing correctly in drl editor. If I swap the positions of units &amp; families then the same exception is thrown for 'units'. </span></font></p><div><font color="navy" face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div><p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">regards,</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">saleem</span></font></p><p style="margin-left: 0.5in;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
-----Original Message-----<br> <b><span style="font-weight: bold;">From:</span></b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org
</a> [<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mailto:rules-users-bounces@lists.jboss.org</a>] <b><span style="font-weight: bold;">On Behalf Of 
</span></b>Edson Tirelli<br> <b><span style="font-weight: bold;">Sent:</span></b> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Tuesday, August 21, 2007</span></font><font face="Tahoma" size="2">
<span style="font-size: 10pt; font-family: Tahoma;"> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">1:56 PM</span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<br> <b><span style="font-weight: bold;">To:</span></b> Rules Users List<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Minor Issue in writing DSL</span></font></p><div style="margin-left: 0.5in;">
<font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font><br></div><p style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<br> &nbsp;&nbsp; Saleem,<br> <br> &nbsp;&nbsp; For sure, your mapping must have some typo or mistake. A rule like this works and is correct:<br> <br> rule XYZ<br> when<br> &nbsp;&nbsp;&nbsp; ObjectA( </span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">
application==true || banker==true || officer==true )<br> then<br> &nbsp; // do something<br> end</span></font></p> <div><p style="margin-left: 0.5in;"><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
&nbsp;&nbsp;&nbsp; Drools does NOT inspect object fields... only public methods.</span></font></span><br> <br> <span>&nbsp;&nbsp;&nbsp; If you are using a DSL, make sure your &quot;drl&quot; file is named &quot;dslr&quot; (this is new in 4.0), so when you open it in eclipse, you have a tab that shows you the result of the DSL template processing. This way you will be able to see any eventual mapping mistake.
</span><br> <br> <span>&nbsp;&nbsp;&nbsp; []s</span><br> <span>&nbsp;&nbsp;&nbsp; Edson</span><br> <br> <br> <span>2007/8/21, Saleem Lakhani &lt; <a href="mailto:Saleem.Lakhani@citizensfla.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Saleem.Lakhani@citizensfla.com</a>&gt;:</span></p> <div link="blue" vlink="blue"> <div><p style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">
When I use the syntax below and write like: </span></font></p><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div>
<p style="margin-left: 0.5in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">[when]ABC=ObjectA(application==true || banker==true || officer==true)</span></font></p><div style="margin-left: 0.5in;"><font face="Courier New" size="2">
<span style="font-size: 10pt;">&nbsp;</span></font><br></div><p style="margin-left: 0.5in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">on drl it gives me the following error:</span></font></p><div style="margin-left: 0.5in;">
<font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font><br></div><p style="margin-left: 0.5in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">Multiple markers at this line:</span>
</font></p><p style="margin-left: 1.25in; text-indent: -0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">-</span></font><font size="1"><span style="font-size: 7.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2">
<span style="font-size: 10pt;">unknown:116:39 Unexpected token &#39;==&#39;</span></font></p><p style="margin-left: 1.25in; text-indent: -0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">-</span></font>
<font size="1"><span style="font-size: 7.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">unknown:116:25 Unexpected token &#39;||&#39;</span></font></p><p style="margin-left: 1.25in; text-indent: -0.25in;">
<font face="Courier New" size="2"><span style="font-size: 10pt;">-</span></font><font size="1"><span style="font-size: 7.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">unknown:116:64 Unexpected token &#39;==&#39;
</span></font></p><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div><p style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial; color: navy;">Again, there are NO attributes in ObjectA named application, banker or officer.</span></font></p><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div><p style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">
Thanks</span></font></p><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font><br></div><div style="margin-left: 0.5in;"><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">
&nbsp;</span></font><br></div><p style="margin-left: 1in;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">-----Original Message-----<br> <b><span style="font-weight: bold;">From:</span></b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> rules-users-bounces@lists.jboss.org</a>] <b><span style="font-weight: bold;">
On Behalf Of </span></b>Edson Tirelli<br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, August 21, 2007 9:49 AM<br> <b><span style="font-weight: bold;">To:</span></b> Rules Users List<br> <b><span style="font-weight: bold;">
Subject:</span></b> Re: [rules-users] Minor Issue in writing DSL</span></font></p><div style="margin-left: 1in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font><br></div><p style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1in;">
<font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br> &nbsp;&nbsp; Drools respects encapsulation, so it works with javabean method name conventions. If you have a method isApplication() that returns a boolean, does not matter how your class calculates the return value. Same for any other method. In 
4.0, you can write:<br> <br> ObjectA( application == true || banker == true )<br> <br> &nbsp;&nbsp; To map that as a DSL, just follow your usual procedure and syntax.<br> <br> &nbsp;&nbsp; []s<br> &nbsp;&nbsp; Edson</span></font></p> <div><p style="margin-left: 1in;">
<font face="Times New Roman" size="3"><span style="font-size: 12pt;">2007/8/21, Saleem Lakhani &lt; <a href="mailto:Saleem.Lakhani@citizensfla.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Saleem.Lakhani@citizensfla.com
</a>&gt;:</span></font></p> <div link="blue" vlink="purple"> <div><p style="margin-left: 1in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p><div style="margin-left: 1in;">
<font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font><br></div><p style="margin-left: 1in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">If I had a rule written in DSL using Drools 
3.0 like;</span></font></p><div style="margin-left: 1in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font><br></div><p style="margin-left: 1.5in; text-indent: -0.25in;"><font face="Times New Roman" size="3">
<span style="font-size: 12pt;">1.</span></font><font size="1"><span style="font-size: 7.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[when] when1=r : ObjectA( )</span>
</font></p><p style="margin-left: 1.5in; text-indent: -0.25in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2.</span></font><font size="1"><span style="font-size: 7.5pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font face="Arial" size="2">
<span style="font-size: 10pt; font-family: Arial;">[when] when2=</span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">eval(r.isApplication() || r.isBanker())</span></font></p><div style="margin-left: 1.25in;">
<font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font><br></div><p style="margin-left: 1.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">There are no attributes in class Object with name application and banker but there are methods in ObjectA with names isApplication() &amp; isBanker() which does some work and return Boolean based on some facts.
</span></font></p><div style="margin-left: 1.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font><br></div><p style="margin-left: 1.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">
What is the correct way of writing the same rule using Drools 4.0 ?</span></font></p><div style="margin-left: 1.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font><br></div><p style="margin-left: 1.25in;">
<font face="Courier New" size="2"><span style="font-size: 10pt;">Also, if the above attributes were present in ObjectA what would have been the best way to write it in DSL using Drools 4.0</span></font></p><div style="margin-left: 1in;">
<font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font><br></div><p style="margin-left: 1in;"><font face="Trebuchet MS" size="2"><span style="font-size: 10pt;">Thanks,</span></font></p>
<div style="margin-left: 1in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font><br></div><div style="margin-left: 1in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
&nbsp;</span></font><br></div> </div> </div><p style="margin-right: 0in; margin-bottom: 12pt; margin-left: 1in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br> _______________________________________________
<br> rules-users mailing list<br> <a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a></span></font></p> </div><p style="margin-left: 1in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
www.jboss.com</a> </span></font></p> </div> </div><p style="margin-right: 0in; margin-bottom: 12pt; margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><br> _______________________________________________
<br> rules-users mailing list<br> <a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a></span></font></p> </div><p style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"><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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
www.jboss.com</a> </span></font></p> </div><div style="margin: 0px;">_______________________________________________</div><div style="margin: 0px;">rules-users mailing list</div><div style="margin: 0px;"><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a></div><div style="margin: 0px;"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users
</a></div> </blockquote></div><br></span></div><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div><span style="text-decoration: underline;"><span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</span></span><div><font size="3"><span style="font-size: 13px;"><b style="font-size: 13px; font-weight: bold;">
<span style="font-size: 13px; font-weight: bold;">Felipe Piccolini M.</span></b></span></font></div><div><a href="mailto:felipe.piccolini@bluesoft.cl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
<span style="color: rgb(0, 0, 238);">felipe.piccolini@bluesoft.cl</span></a></div><br></div><div><br></div><br></span> </div><br></div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" 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>&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>