<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle20
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks </span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Edson. That helped.
One more thing, can&#8217;t we execute something simple like: ObjectA</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>(units != families)</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>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>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=red face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:red'>org.drools.rule.InvalidRulePackage:
Unable to return Declaration for identifier 'families' : [Rule name=Rule6, agendaGroup=Rating,
salience=0, no-loop=false]</span></font><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> Its even showing correctly in drl editor. If I swap the positions
of units &amp; families then the same exception is thrown for &#8216;units&#8217;.
</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>regards,</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>saleem</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <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 size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Tuesday, August
 21, 2007</span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> </span></font><font size=2 face=Tahoma><span
 style='font-size:10.0pt;font-family:Tahoma'>1:56 PM</span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;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>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><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 size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>application==true ||
banker==true || officer==true )<br>
then<br>
&nbsp; // do something<br>
end</span></font></p>

<div>

<p class=MsoNormal style='margin-left:.5in'><span class=gmailquote><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;
Drools does NOT inspect object fields... only public methods.</span></font></span><br>
<br>
<span class=gmailquote>&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 class=gmailquote>&nbsp;&nbsp;&nbsp; []s</span><br>
<span class=gmailquote>&nbsp;&nbsp;&nbsp; Edson</span><br>
<br>
<br>
<span class=gmailquote>2007/8/21, Saleem Lakhani &lt; <a
href="mailto:Saleem.Lakhani@citizensfla.com">Saleem.Lakhani@citizensfla.com</a>&gt;:</span></p>

<div link=blue vlink=blue>

<div>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>When I use the syntax
below and write like: </span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>[when]ABC=ObjectA(application==true
|| banker==true || officer==true)</span></font></p>

<p style='margin-left:.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>on drl it gives me the
following error:</span></font></p>

<p style='margin-left:.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Multiple markers at this
line:</span></font></p>

<p style='margin-left:1.25in;text-indent:-.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font size=1><span
style='font-size:7.5pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>unknown:116:39
Unexpected token '=='</span></font></p>

<p style='margin-left:1.25in;text-indent:-.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font size=1><span
style='font-size:7.5pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>unknown:116:25
Unexpected token '||'</span></font></p>

<p style='margin-left:1.25in;text-indent:-.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font size=1><span
style='font-size:7.5pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>unknown:116:64
Unexpected token '=='</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Again, there are NO
attributes in ObjectA named application, banker or officer.</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p style='margin-left:1.0in'><font size=2 face=Tahoma><span style='font-size:
10.0pt;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:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p style='margin-right:0in;margin-bottom:12.0pt;margin-left:1.0in'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><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:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>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:1.0in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Hi,</span></font></p>

<p style='margin-left:1.0in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p style='margin-left:1.0in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>If I had a rule written in DSL using Drools 3.0 like;</span></font></p>

<p style='margin-left:1.0in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p style='margin-left:1.5in;text-indent:-.25in'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>1.</span></font><font
size=1><span style='font-size:7.5pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>[when]
when1=r : ObjectA( )</span></font></p>

<p style='margin-left:1.5in;text-indent:-.25in'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>2.</span></font><font
size=1><span style='font-size:7.5pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>[when]
when2=</span></font><font size=2 face="Courier New"><span style='font-size:
10.0pt;font-family:"Courier New"'>eval(r.isApplication() || r.isBanker())</span></font></p>

<p style='margin-left:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p style='margin-left:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>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:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p style='margin-left:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>What is the correct way of
writing the same rule using Drools 4.0 ?</span></font></p>

<p style='margin-left:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font></p>

<p style='margin-left:1.25in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>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:1.0in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p style='margin-left:1.0in'><font size=2 face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS"'>Thanks,</span></font></p>

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

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

</div>

</div>

<p style='margin-right:0in;margin-bottom:12.0pt;margin-left:1.0in'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><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:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><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 class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org"
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 class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><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>
</span></font></p>

</div>

</body>

</html>