<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( <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<br></span></font><br><div><span class="gmail_quote">&nbsp;&nbsp;&nbsp; Drools does NOT inspect object fields... only public methods.<br><br>&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.<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><br>2007/8/21, Saleem Lakhani &lt;
<a href="mailto:Saleem.Lakhani@citizensfla.com">Saleem.Lakhani@citizensfla.com</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 link="blue" vlink="blue" lang="EN-US">

<div>

<p><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>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">[when]ABC=ObjectA(application==true || banker==true
|| officer==true)</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">on drl it gives me the following error:</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt;">Multiple markers at this line:</span></font></p>

<p style="margin-left: 0.75in; text-indent: -0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">-<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">unknown:116:39 Unexpected
token '=='</span></font></p>

<p style="margin-left: 0.75in; text-indent: -0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">-<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">unknown:116:25 Unexpected
token '||'</span></font></p>

<p style="margin-left: 0.75in; text-indent: -0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">-<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></font><font face="Courier New" size="2"><span style="font-size: 10pt;">unknown:116:64 Unexpected
token '=='</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><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>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks</span></font></p><span class="q">

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</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> [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>

<p style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

<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; 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>

</span><div><span class="q">

<p style="margin-left: 0.5in;"><span><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></span></p>

</span><div link="blue" vlink="purple">

<div><span class="q">

<p style="margin-left: 0.5in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p>

<p style="margin-left: 0.5in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p style="margin-left: 0.5in;"><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>

<p style="margin-left: 0.5in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p></span>

<p style="margin-left: 1in; text-indent: -0.25in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">1.<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></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: 1in; text-indent: -0.25in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2.<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></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><span class="q">

<p style="margin-left: 0.75in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></p>

<p style="margin-left: 0.75in;"><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>

<p style="margin-left: 0.75in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></p>

<p style="margin-left: 0.75in;"><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>

<p style="margin-left: 0.75in;"><font face="Courier New" size="2"><span style="font-size: 10pt;">&nbsp;</span></font></p>

<p style="margin-left: 0.75in;"><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>

<p style="margin-left: 0.5in;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p style="margin-left: 0.5in;"><font face="Trebuchet MS" size="2"><span style="font-size: 10pt;">Thanks,</span></font></p>

<p style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

<p style="margin-left: 0.5in;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

</span></div>

</div><span class="q">

<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>

</span></div><span class="q">

<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>

</span></div>

</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>