If you are using trunk:
rule Timer
when
clock : AlarmClock( ( alarmTime.getHour() > 10 ) )
then
// do something
end
Please note that the double "(" are needed as the above is a predicate.
If you are using 3.0.x, you need to bind the field first. So:
rule Timer
when
clock : AlarmClock( $alarmTime : alarmTime -> ( $alarmTime.getHour() >
10 ) )
then
// do something
end
Hope it helps.
[]s
Edson
2007/5/8, seeker <janko.dimitroff(a)dai-labor.de>:
I'd like to build a rule which tests for a special property.
rule "Timer"
when
clock : AlarmClock( $time : alarmTime)
then
// some consequences..
the problem is the $time. I bound it to a variable so far.
It is a complex object which I actually want to check for
getAlarmTime().getHour() > 10
I dont know how.
I want the rule to fire if the hour of the alarmTime has reached a certain
value.
--
View this message in context:
http://www.nabble.com/rule-creation-tf3709922.html#a10376825
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @
www.jboss.com