Reputation: 33
I have the value like starttime(8.30 am) to endtime(5.00pm) .I need to check that whether current time is between the stattime and endtime.
rule "rule1"
when
day="Monday" && currentTime between (8.45am) and (5.00pm) ;
then
return true;
when
day="Sunday" && currentTime between (9.00am) and (11.00am);
Then
return true;
End
Upvotes: 1
Views: 434
Reputation: 31300
Insert an object of a simple class TimeOfWeek with the day of the week and the current time of the day. Then you may
TimeOfWeek( wday == "Monday", tod >= 945 && tod <= 1700 )
@J Andy: Fusion and the temporal operators deal with events, timestamped with absolute time values. That's not what OPs constraints appear to need.
Upvotes: 2