ルール変数へのルール・アクションの依存

ルールの変数をオブジェクトによってインスタンス化できない場合、ルールのアクションを実行することはできません。

ルール変数は、ルールの definitions 部分で定義します。 ルールの変数をオブジェクトによってインスタンス化できない場合、ルールはアクションを実行できません。

ルールに変数と条件が含まれる場合、ルールが else 部分を実行できるのは、変数をオブジェクトによってインスタンス化できて、条件が true でない場合に限られます。

次のルールでは、すべての顧客が最低でも 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