<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<br><br><div><span class="gmail_quote">2007/8/21, Saleem Lakhani <
<a href="mailto:Saleem.Lakhani@citizensfla.com">Saleem.Lakhani@citizensfla.com</a>>:</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="purple" lang="EN-US">
<div>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><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><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<ol start="1" type="1">
<li><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[when] when1=r : ObjectA( )</span></font></li>
<li><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></li>
</ol>
<p style="margin-left: 0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>
<p style="margin-left: 0.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() & isBanker() which does some work and return Boolean
based on some facts.</span></font></p>
<p style="margin-left: 0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>
<p style="margin-left: 0.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>
<p style="margin-left: 0.25in;"><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></p>
<p style="margin-left: 0.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>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Trebuchet MS" size="2"><span style="font-size: 10pt;">Thanks,</span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
</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> 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>