定義に基づくクエリー
プロジェクト・エレメント定義でフィルター処理をして、クエリーを調整できます。
定義に基づくクエリーは、メンバーの値を使用または変更するルール、あるいはメソッドを呼び出すルールを検索します。 任意のタイプのルールに対してこのタイプのクエリーを実行できます。 このクエリーはポリシー変更で影響を受けるルールを識別するために役立ちます。
- uses the phrase と uses the phrase ... where の各述語は、メソッドを呼び出すルールを検索します。
名前は類似していますが、 uses the phrase クエリーと uses the phrase ... where クエリーでは動作が異なります。 最初のクエリー (uses the phrase) は、ルールの構文上の形式を調べるのに対し、2 番目のクエリー (uses the phrase ... where) は、ルールの動作を調べます。言い換えると、 uses the phrase クエリーは、ルールのテキスト表現にメソッド呼び出しが含まれるかどうかを調べ、 uses the phrase ... where クエリーは、ルールの実行によってメソッドが呼び出されるかどうかと、メソッドの引数が制約を満たすかどうかを調べます。 最初のクエリーは、絶対に適用されないルールを返す 可能性がありますが、2 番目のクエリーは、絶対に適用されないルールは 返しません (そのようなルールは実行されないため)。
- uses the value of と modifies the value of の各述語は、メンバーの値を使用または変更するルールを検索します。
- is using the BOM class と is using the BOM member の各述語は、BOM クラスまたは BOM メンバーを使用するルールを検索します。
「is using BOM class」または「is using BOM member」述語を指定したクエリーは、最終変更日以降にワークスペースが再作成された場合にのみ機能します。 そうでない場合は、結果が正確でない場合があります。選択された BOM クラスまたはメンバーを言語化する必要があります。
uses the phrase
述語 uses the phrase <a method verbalization> は、指定されたメソッドを呼び出すルールを返します。
例
次のクエリーは、以下のように「a number」を「a report」の企業スコアに追加するメソッドを呼び出すアクション・ルールをすべて返します。
Find all action rules such that each action rule uses the phrase [ add 'a number' to the corporate score in 'a report' ]
uses the phrase ... where
述語 uses the phrase ... where <a method verbalization with a constraint on method arguments> は、引数への制約が適用される特定のメソッドを呼び出すルールを返します。
このクエリーは、プロジェクト・エレメント定義およびルールの意味的内容でフィルター処理をします。
例 1
次のクエリーは、'a borrower' のクレジット・スコアに 'a number' を設定し、その数値が 100 に等しいメソッドを呼び出すビジネス・ルールをすべて返します。
Find all business rules such that each business rule uses the phrase [ set the credit score of 'a borrower' to 'a number' , where 'a number' equals 100 ]
このクエリーは、次のルールを返します。
if the age of 'the borrower' is 30 then set the credit score of 'the borrower' to 100;
例 2
次のクエリーは、'a borrower' のクレジット・スコアに 'a number' を設定し、その数値が 100 以上のメソッドを呼び出すビジネス・ルールをすべて返します。
Find all business rules such that each business rule uses the phrase [ set the credit score of 'a borrower' to 'a number' , where 'a number' is at least 100 ]
このクエリーは、次のルールを返します。
if the age of 'the borrower' is 30 then set the credit score of 'the borrower' to 200;
例 3
次のクエリーは、'a borrower' に割引 'a number' を与え、その場合の 'a borrower' クレジット・スコアが 200 以下のメソッドを呼び出すビジネス・ルールをすべて返します。
Find all business rules such that each business rule uses the phrase [give the discount 'a number' to 'a borrower' where the credit score of 'a borrower' is at most 200]
制約に含まれる BOM エレメントがルールに表示されないとき、このルールが返されます。 次のルールでは、'借り手' のカテゴリーはゴールドである、という事実は、'借り手' のクレジット・スコアが 200 以下である可能性を除外しません。
このクエリーは、次のルールを返します。
if the category of 'the borrower' is Gold then give the discount 10 to 'the borrower';
このクエリーは、次のルールは返しません。
if the credit score of 'the borrower' equals 300 then give the discount 10 to 'the borrower';
例 4
次のクエリーは、ローン金額の範囲を <min> および <max> に設定し、最大率が <max> であるメソッドを呼び出すビジネス・ルールをすべて返します。その場合、<min> パラメーターおよび <max> パラメーターの値は 10000 未満で、<rate> パラメーターは 15% より大きいものとします。
Find all business rules such that each business rule uses the phrase [ set the loan amount range to 'a number' and 'another number', with a maximum rate of 'a number 3', where 'a number' is lower than 10000, and 'another number' is lower than 10000, and 'a number 3' is greater than 15 % ]
プレースホルダーごとに定義済み変数を選択できます。 各変数には、対応するプレースホルダーのタイプがあります。 変数のタイプが String または Number の場合、'a number'、'another number'、'a number 3'、'a number 4' など、変数を最大 10 個選択できます。 その他のいずれかのタイプの場合は、変数を最大 3 個選択できます。
また、クエリーの制約部分で定義済み変数を選択して、それらの変数に制約を適用することもできます。
uses the value of
述語 uses the value of <an attribute, ruleset parameter, or variable> は、特定のメンバーの値を使用するルールを返します。
例
次のクエリーは、ローンの等級値を使用するすべてのビジネス・ルールを返します。
Find all business rules such that each business rule uses the value of the loan grade in 'a report'
modifies the value of
述語 modifies the value of <an attribute, ruleset parameter, or variable> は、特定のメンバーを変更するルールを返します。
例
次のクエリーは、ローン・レポート・ルール・セット・パラメーターの保険料率を変更する意思決定表をすべて返します。
Find all decision tables such that each decision table modifies the value of the insurance rate of 'the loan report'
is using the BOM class
述語 is using the BOM class は、特定のクラスのインスタンスに対するバインディングを使用するか、このクラスにリンクされている自動変数を使用して、このクラスを参照するルールを返します (Rule Designer のみ)。
このクエリーはビジネス・ルール・アーティファクトのみを返し、テクニカル・ルールを返しません。
例
次のクエリーは、クラス Borrower を使用するビジネス・ルールをすべて返します。
Find all business rules such that each business rule is using the BOM class "loan.Borrower"また、述語 「is not using BOM class」 も使用できます。
is using the BOM member
特定の BOM メンバーを参照するルールを返します (Rule Designer のみ)。
このクエリーはビジネス・ルール・アーティファクトのみを返し、テクニカル・ルールを返しません。
例
次のクエリーは、Loan クラスの amount 属性を読み取るか 変更するビジネス・ルールをすべて返します。
Find all business rules such that each business rule is using the BOM Member "loan.Loan.amount"
また、述語 「is not using BOM member」も使用できます。