<br> If you are using trunk:<br><br>rule Timer<br>when<br> clock : AlarmClock( ( alarmTime.getHour() > 10 ) )<br>then<br> // do something<br>end<br> <br> Please note that the double "(" are needed as the above is a predicate.
<br><br> If you are using 3.0.x, you need to bind the field first. So:<br><br>rule Timer<br>
when<br>
clock : AlarmClock( $alarmTime : alarmTime -> ( $alarmTime.getHour() > 10 ) )<br>
then<br>
// do something<br>
end<br>
<br> Hope it helps.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/5/8, seeker <<a href="mailto:janko.dimitroff@dai-labor.de">janko.dimitroff@dai-labor.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I'd like to build a rule which tests for a special property.<br><br>rule "Timer"<br> when<br> clock : AlarmClock( $time : alarmTime)<br> then<br>// some consequences..<br><br>
the problem is the $time. I bound it to a variable so far.<br>It is a complex object which I actually want to check for<br>getAlarmTime().getHour() > 10<br><br>I dont know how.<br>I want the rule to fire if the hour of the alarmTime has reached a certain
<br>value.<br>--<br>View this message in context: <a href="http://www.nabble.com/rule-creation-tf3709922.html#a10376825">http://www.nabble.com/rule-creation-tf3709922.html#a10376825</a><br>Sent from the drools - user mailing list archive at
<a href="http://Nabble.com">Nabble.com</a>.<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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><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>