[rules-users] rule creation

Anstis, Michael (M.) manstis1 at ford.com
Tue May 8 10:49:15 EDT 2007


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: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of seeker
Sent: 08 May 2007 15:22
To: rules-users at lists.jboss.org
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
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list