<br>&nbsp;&nbsp;&nbsp;&nbsp; Drools does not look at the class attributes. All he cares are the methods. In your example:<br><br>
rule &quot;Some Rule&quot;<br>
 &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp;$MyFact :A( $first : first )<br>&nbsp; then<br><br>&nbsp;&nbsp;&nbsp; Will work just fine, because when drools see &quot;first&quot;, he will look for a method called either &quot;getFirst()&quot; or &quot;isFirst()&quot; or in last case &quot;first()&quot;.<br>
<br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><br><br><div class="gmail_quote">2008/5/8 sridhar123 &lt;<a href="mailto:sridhar.peddinti@sabre.com">sridhar.peddinti@sabre.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I am trying to access Fact objects that are not always java beans. Example:<br>
<br>
Class A {<br>
 &nbsp;Arraylist &nbsp;Class B b<br>
<br>
 &nbsp;getFirst() { return b.first() }<br>
<br>
 &nbsp;}<br>
<br>
In above Class i dont have any variable called &quot;first&quot; - but returning first<br>
element of the list.<br>
<br>
Now following DRL throws compilation errors.<br>
<br>
rule &quot;Some Rule&quot;<br>
 &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp;$MyFact :A()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;$first : $myFact.getFirst()<br>
 &nbsp; then<br>
 &nbsp; &nbsp; &nbsp; ....<br>
 &nbsp; &nbsp; &nbsp; ....<br>
end<br>
<br>
Is there any way to execute the above - or i should have class variable<br>
&quot;first&quot; and access that?<br>
<br>
thank you<br>
Sridhar<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Facts---can-they-be-non-Java-Beans-tp17130130p17130130.html" target="_blank">http://www.nabble.com/Facts---can-they-be-non-Java-Beans-tp17130130p17130130.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<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>