<br> Drools does not look at the class attributes. All he cares are the methods. In your example:<br><br>
rule "Some Rule"<br>
when<br>
$MyFact :A( $first : first )<br> then<br><br> Will work just fine, because when drools see "first", he will look for a method called either "getFirst()" or "isFirst()" or in last case "first()".<br>
<br> []s<br> Edson<br><br><br><br><div class="gmail_quote">2008/5/8 sridhar123 <<a href="mailto:sridhar.peddinti@sabre.com">sridhar.peddinti@sabre.com</a>>:<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>
Arraylist Class B b<br>
<br>
getFirst() { return b.first() }<br>
<br>
}<br>
<br>
In above Class i dont have any variable called "first" - but returning first<br>
element of the list.<br>
<br>
Now following DRL throws compilation errors.<br>
<br>
rule "Some Rule"<br>
when<br>
$MyFact :A()<br>
$first : $myFact.getFirst()<br>
then<br>
....<br>
....<br>
end<br>
<br>
Is there any way to execute the above - or i should have class variable<br>
"first" 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>