<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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.EmailStyle19
        {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;}
/* List Definitions */
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</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'>When I use the syntax below and write
like: </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><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 class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal><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 class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> </span></font></p>
<p class=MsoNormal><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 class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>-<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></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 class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>-<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></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 class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>-<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></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 class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><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 class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </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> 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 class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </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>
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>
To map that as a DSL, just follow your usual procedure and syntax.<br>
<br>
[]s<br>
Edson</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'>2007/8/21, Saleem
Lakhani < <a href="mailto:Saleem.Lakhani@citizensfla.com">Saleem.Lakhani@citizensfla.com</a>>:</span></font></span></p>
<div link=blue vlink=purple>
<div>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Hi,</span></font></p>
<p style='margin-left:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'> </span></font></p>
<p style='margin-left:.5in'><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:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'> </span></font></p>
<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>1.<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></font><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>[when] when1=r : ObjectA( )</span></font></p>
<p class=MsoNormal style='margin-left:1.0in;text-indent:-.25in'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>2.<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></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:.75in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p style='margin-left:.75in'><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() & isBanker() which does some work and return
Boolean based on some facts.</span></font></p>
<p style='margin-left:.75in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p style='margin-left:.75in'><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:.75in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> </span></font></p>
<p style='margin-left:.75in'><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:.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'> </span></font></p>
<p style='margin-left:.5in'><font size=2 face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS"'>Thanks,</span></font></p>
<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </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>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<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>
</span></font></p>
</div>
</body>
</html>