ステートメントを比較する条件
イベントとエンティティーの数値およびブール値 (true または false)、日付、テキスト・ストリング、および属性を比較し、操作する条件を作成することができます。
以下の例は、いくつかのテキスト、数値、および時間の演算子を示しています。
ルールで使用可能な演算子のリストを表示するには、ビジネス・ルール言語を参照してください。
- starts with および ends with
以下のように、テキスト演算子 starts with および ends with を使用して、テキスト・ストリングが特定の文字シーケンスで開始または終了するかどうかを判別できます。
if the maintenance number of 'the customer' starts with “TX” then print "redirect the call to call center A";
- is more than および is less than
以下のように、数値演算子 is more than および is less than を使用して、2 つの数値を比較することができます。
if the purchase value of 'the shopping cart' is more than $100 then print "apply a 10% discount to the value of the shopping cart";
- after および before
以下のように、日時演算子 after と before、およびその他の演算子を使用して、時刻を比較することができます。
definitions set 'the pickup date' to the pickup date of 'the rented car'; set 'the scheduled return date' to the scheduled return date of 'the rented car'; if the return date of 'the rented car' is after 'the pickup date' and before 'the scheduled return date' then...以下のルールは、エージェントが return イベントを受信した時にのみ適用可能になります。
when a return event occurs, called 'the return' definitions set 'the purchase' to a purchase event; if 'the return' is after the period of 1 week after 'the purchase' then...
時間とロケーションの比較について詳しくは、時間およびイベントについての理由付けおよび地理的位置についての理由付けを参照してください。