Scheduling the execution of a rule

You can define when a rule must be executed by writing a temporal condition that uses the time now.

In the if statement of the rule, you can schedule a rule to be triggered at a certain time in the future or at regular intervals.
  • A rule can be triggered at a specific time point after the time now.
  • A rule can be evaluated repeatedly at a specified time component, for example, every day at 5:00 PM or every Saturday.

    For time periods such as Saturday, the rule is evaluated at the start of the period.

The following rule is evaluated every day at 12:00 AM, and prints a warning if the balance equals 0.

if
    the time of day of now is 12:00:00 AM
    and the balance of 'the account' is less than 0
then
    print "Warning: the balance of the account is 0" ;

The following rule is scheduled to be evaluated every day from 11:00 AM. The rule is triggered if the rest of the condition is true, and it can be executed several times in the day.

if
    the YTD total of 'the customer' is more than 1500 
    and the time of day of now is after 11:00:00 AM 
then 
    print "Warning: the YTD total of the customer is more than 1500";

The following rule sends a reminder each Monday at 10:00 AM:

if 
 now is on Monday at 10:00:00 AM
then 
	 print "send weekly reminder.";