ルール変数に対するルール・アクションの依存
ルールの変数をオブジェクトでインスタンス化できない場合は、そのルールのアクションを実行することはできません。
ルール変数は、ルールの definitions 部分で定義します。 ルールの変数をオブジェクトでインスタンス化できない場合、ルールを実行したりアクションを実行したりすることはできません。
ルールに変数と条件がある場合、変数をオブジェクトでインスタンス化でき、条件が true ではない場合にのみ、ルールはその else 部分を実行することができます。
以下のルールでは、すべての顧客が少なくとも 5 % のディスカウントを受けるため、常にディスカウントが適用されます。
if all of the following conditions are true: the value of the customer's shopping cart is more than $100 the category of the customer is Gold then apply a 15% discount else apply a 5% discount
しかし、definitions 部分を使用して、ゴールド・カテゴリーの顧客にのみディスカウントを提供すると、そのルールを変更することができます。
definitions set applicant to a customer where the category of this customer is Gold if the value of the applicant's shopping cart is more than $100 then apply a 15% discount else apply a 5% discount