You can achieve your requirement with an "eval" - the usual "evals are bad" disclaimers apply ;-)
AlarmClock( $time : alarmTime ) eval( $time.getHour() > 10 ) Or with a simple pattern where object model allows:- $clock : AlarmClock ( ) AlarmTime ( hour > 10, clock == $clock ) Or with a return value operator (I think):- $clock : AlarmClock( ) AlarmTime ( hour == ( $clock.getHour() ) ) Relationships between objects have to be preserved by the rules. Whether there are other options in 4.0-M2 I don't know. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of seeker Sent: 08 May 2007 15:22 To: [email protected] Subject: [rules-users] rule creation 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 [email protected] https://lists.jboss.org/mailman/listinfo/rules-users _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
