クエリー条件

クエリー条件は、検索用に定義する基準です。

クエリー条件は、クエリーの Find 部分の下に表示されます。

デフォルトで、クエリーはビジネス・ルールに対して実行されますが、アクション・ルール、意思決定表、企業に固有の別のタイプのルールなど、 特定のビジネス・ルールのタイプを検索することもできます。

フォルダー (ルール・パッケージ)、ルール・フロー、スマート・フォルダー、関数、変数セットを検索することもできます。

注:

クエリーは、プロジェクト・エレメントの作業バージョン、つまり、Decision Center で現在選択されているベースラインで参照されたバージョンについてのみ行うことができます。

最初に、クエリーの実行対象となるプロジェクト・エレメントを選択します。 次に、such that ステートメントとそれに続く条件ステートメントという形式でフィルターを追加して、クエリーを調整することができます。

例

Find all business rules
   such that the effective date of each business rule is after 31/1/2016
   and the effective date of each business rule is before 28/2/2016
such that ステートメントを使用してさまざまなプロジェクト・アイテム (以下) をフィルター処理し、クエリーを調整できます。
注:

現在のセッションでどのルールが変更されたか識別したり (after my login time でクエリー)、自分が変更したルールを識別したり (creator is me でクエリー) することができます。

プロパティーによるフィルター処理

クエリー対象のプロジェクト・エレメントのプロパティーのいずれかに従ってクエリーをフィルター処理できます (プロジェクト・エレメントのプロパティー を参照)。

例えば、以下のクエリーでは状況が new のビジネス・ルールのみが表示されます。

Find all business rules
   such that the status of each business rule is new

ビジネス用語によるフィルター処理

ルールの条件とアクションで使用するビジネス用語に従ってクエリーをフィルター処理できます。 このタイプのフィルターは、例えばポリシーの変更によって影響を受けるルールを検索する場合に便利です。

Find all business rules
   such that each business rule modifies the value of the insurance rate

次のクエリーのコンストラクトでは、ビジネス用語を使用または変更するルールを検索します。

は~の値を使用する

特定のビジネス用語の値を使用するルールを返します。

例

次のクエリーは、ローンの等級値を使用するすべてのビジネス・ルールを返します。

Find all business rules
   such that each business rule uses the value of the loan grade in 'a report'
の句を使用する

特定のビジネス用語を呼び出すルールを返します。

例

次のクエリーは、「レポートの企業スコアに追加する」を使用するすべてのビジネス・ルールを返します。

Find all business rules
   such that each business rule uses the phrase [ add 'a number' to the corporate
   score in 'a report' ]
句~を使用する ... ここで

制約が適用される特定のビジネス用語を呼び出すルールを返します。

例 1

次のクエリーは、'借り手' のクレジット・スコアに '数値' を設定し、その数値が 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

次のクエリーは、'借り手' のクレジット・スコアに '数値' を設定し、その数値が 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

次のクエリーは、'借り手' に割引 '数値' を与え、その場合の '借り手' クレジット・スコアが 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]

制約に記述されているエレメントがルールに表示されないとき、このルールが返されます。 次のルールでは、'借り手' のカテゴリーはゴールドである、という事実は、'借り手' のクレジット・スコアが 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';
の値を変更する

特定のビジネス用語を変更するルールを返します。

例

次のクエリーは、保険料率を変更するすべての意思決定表を返します。

Find all decision tables
   such that each decision table modifies the value of 'the insurance rate'

実行時のルールの振る舞いによるフィルター処理

ルールのセマンティック、つまり実行中の振る舞いにしたがってクエリーにフィルターを適用します。 このタイプのフィルターは、特定の条件が真である、または真になるときに適用できるルールを検索します。 このフィルターは、ルールの実行に適用される条件をテストし、それらが予期したとおりに振る舞うことを確認するために役立ちます。

次のセマンティック・クエリー・コンストラクトを使用することができます。

を適用できる

条件部分がクエリー条件に一致するすべてのルール、またはルール条件にクエリー条件と相反するものが何もないときに返されます。 その結果、このクエリーは、クエリー条件に特に該当しない条件のあるルールも返します。

例

ルール 1: If the score of the borrower is at least 10 then...

ルール 2: If the age of the borrower is at least 21 then...

ルール 3: If the score of the borrower is less than 10 and the age of the borrower is more than 35 then...

クエリー 1:

Find all business rules
   such that each business rule may apply when the score of the borrower is 20 

クエリー 2:

Find all business rules
   such that each business rule may apply when the score of the borrower is 5

クエリー 1 は、ルール 1 とルール 2 を返します。ルール 1 は、「借り手のスコアが 10 以上の場合、20 もありうる」ということで返されます。ルール 2 は、「条件が適用されないことが明記されていないため、借り手のスコアが 20 のこともありうる」ということで返されます。ルール 3 は、「スコアが 10 未満」という条件を含み、ルールが適用できないことが明白なため、返されません。

クエリー 2 は、ルール 2 とルール 3 を返します。ルール 1 は、クエリー条件が「スコアが 10 未満」と設定されているため、該当しません。 ルール 2 は、スコアが 5 であることを明確に否定していません。ルール 3 は、少なくとも 1 つの条件が該当し、もう一方の条件ではスコアが 5 であるという事実が否定されていません。

時に適用可能となる

条件部分がクエリー条件に該当するルールのみを返す、さらに特化したクエリーです。 このクエリーは、クエリー条件に特に該当しない条件のあるルールは返しません。

例

ルール 3: If the category of the customer is Platinum then...

ルール 4: If the category of the customer is not Platinum then...

ルール 5: If the age of the customer is at most 65 then...

ルール 6: If the age of the customer is at most 65 and the category of the customer is not Platinum...

クエリー 1:

Find all business rules
   such that each business rule may become applicable when the category of
   'a customer' is Gold 

このクエリーは、ルール 4 とルール 6 を返します。ルール 4 は、顧客カテゴリーがプラチナではない場合、ゴールドでありうるため、返されます。 ルール 6 も同じ理由で返されます。 顧客の年齢に関する追加条件は、カテゴリーがゴールドであるという条件に反しません。

ルール 3 は顧客カテゴリーがプラチナとなっているのでゴールド・カテゴリーには該当せず、クエリーから返されません。 このクエリーは、顧客カテゴリーがゴールドのときに適用可能となるルールを検索しているので、顧客の年齢はこのクエリーには該当せず、ルール 5 も返されません。 言い換えると、ルール条件は顧客カテゴリーがゴールドであることに影響を受けません。

クエリー 2:

Find all business rules
   such that each business rule may become applicable when [the age of
   'a customer' is at least 21] 

このクエリーは、顧客年齢が 21 を超えた場合に適用可能に「変わる」ルールを検索しているので、ルール 5 を返しません。 ルール 5 は、顧客年齢が 21 未満の場合でも適用可能です。 そのため、ルール 5 は適用可能に「変わる」ことはありませんが、顧客年齢が 21 未満から 21 以上に変わっても適用可能「のまま」となります。

の状態に導く可能性あり

実行時にクエリー条件に一致する結果を表示するルールを返します。 このクエリーは、ルールの条件部分とアクション部分の両方を考慮します。 ルールの及ぼす影響を基に、ルールにフィルターを適用します。 そのため、クエリー条件に影響を及ぼさないルールは返されません。

例

ルール 7: If the age of the borrower is at least 25 then set the credit score of the borrower to 60

ルール 8: If the age of the borrower is more than 18 and less than 25 then set the credit score of the borrower to 20

クエリー:

Find all business rules
   such that each business rule may lead to a state where the credit score of
   the borrower is more than 50

このクエリーは、ルール 7 は返しますが、ルール 8 は返しません。これは、借り手の年齢がチェックされてクレジット・スコアが設定されると、ルール 7 のみが 50 を越す結果を示します。

実行時のルールの影響によるフィルター処理

ルール間のリンクと依存性を識別することによって、ルールにフィルターを適用することができます。 ルール実行が他のルールの適用性に与える影響と、ルールが他のルールの実行によって受ける影響をチェックすることができます。

は~を選択する可能性がある

指定ルールを選択できるルール・フローとルール・タスクを返します。

例

次のクエリーは、「ルール 1」を選択できるルール・フローとルール・タスクを返します。

Find all ruleflows
   such that each ruleflow may select "Rule 1"
(ルール) を有効にする可能性がある

指定ルールを適用可能にするルールを返します。

例

ルール 1:

if the age of the customer is 25 
then set the category of the customer to Bronze ;

ルール 2:

if the category of the customer is Bronze 
then give Champagne to the shopping cart of the customer with message: "Congratulations" ;

クエリー:

Find all business rules
   such that each business rule may enable "Rule 2" 

このクエリーは、ルール 1 を返します。これは、ルール 1 が顧客カテゴリーをブロンズに設定するので、それによりルール 2 の条件が有効になるからです。

は~を無効にする可能性がある

指定ルールを適用不可にするルールを返します。

例

ルール 1:

if the age of the customer is 18 
then set the category of the customer to Copper ;

ルール 2:

if the category of the customer is Bronze 
then give Champagne to the shopping cart of the customer with message: "Congratulations" ;

ルール 3:

if the age of the customer equals 25 and the category of the customer is Bronze 
then set the category of the customer to Diamond ;

クエリー:

Find all business rules
   such that each business rule may disable "Rule 2" 

このクエリーは、ルール 1 とルール 3 を返します。ルール 1 は、顧客カテゴリーがコッパーに設定されるとブロンズにはならないため、返されます。 ルール 3 も返されます。これは、条件の 1 つで顧客カテゴリーはブロンズになってはいますが、アクションで顧客カテゴリーがダイヤモンドに設定されているからです。 そのため、顧客カテゴリーがダイヤモンドであれば、ルール 2 は適用不可になります。

は~によって有効になる可能性がある

指定ルールによって適用可能になるルールを返します。

例

ルール 1:

if the age of the customer is 18 
then set the category of the customer to Copper ;

ルール 2:

if the category of the customer is Bronze 
then give Champagne to the shopping cart of the customer with message: "Congratulations" ;

ルール 3:

if the age of the customer equals 25 and the category of the customer is Gold 
then set the category of the customer to Diamond ;

クエリー:

Find all business rules
   such that each business rule may disable "Rule 2" 

このクエリーは、ルール 1 を返します。ルール 1 は、顧客カテゴリーがコッパーに設定されるとブロンズにはならないため、返されます。 アクションは顧客カテゴリーがダイヤモンドに設定されているため、ルール 3 は返されず、カテゴリーが既にブロンズでない状態からのみ実行されます。 そのため、ルール 3 はルール 1 を無効にしません。

は~によって無効になる可能性がある

指定ルールによって適用不可になるルールを返します。

例

ルール 1:

if the age of the customer is 25 
then set the category of the customer to Bronze ;

ルール 2:

if the age of the customer equals 25 and the category of the customer is Copper
then set the category of the customer to Gold

クエリー:

Find all business rules
   such that each business rule may be disabled by "Rule 1" 

ルール 2 は、ルール 1 によって適用不可になるため、返されます。ルール 1 では、25 歳の顧客のカテゴリーはブロンズに設定されているため、コッパーではありません。