ルールの実行のスケジューリング
時間 now を使用する時間条件を作成して、いつルールを実行する必要があるかを定義することができます。
ルールの if ステートメントで、将来のある特定の時刻、または定期的な間隔でルールをトリガーするようにスケジュールを設定することができます。
- ルールは、時間 now の後の特定の時刻にトリガーすることができます。
- ルールは、指定された時間構成 (例えば、毎日 5:00 PM または毎週土曜日など) で繰り返し評価することができます。
土曜日などの期間の場合、ルールはその期間の開始時に評価されます。
以下のルールは、毎日 12:00 AM に評価され、残高が 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" ;
以下のルールは、毎日 11:00 AM から評価するようにスケジュールが設定されています。このルールは、残りの条件が true の場合トリガーされ、一日に複数回実行できます。
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";
以下のルールは、毎週月曜日 10:00 AM にリマインダーを送信します。
if
now is on Monday at 10:00:00 AM
then
print "send weekly reminder.";