Queries on semantic content
This type of query uses the phrases of the vocabulary that refer to members. It finds rules that could be applicable when certain conditions are true or could become true. It is useful for testing the conditions under which rules would be executed to make sure that they behave as expected.
-
Action rules: a type of business rule whose purpose is to do an action
-
Business rules: any rule written using the Business Action Language (BAL)
-
Decision tables: business rules written in table format, where each row corresponds to a single rule
-
Decision trees: business rules written in the form of a tree
-
Technical rules: rules written using the ILOG® Rule Language (IRL)
-
All rules: any type of rule, including decision tables or decision trees
You can run a query on all rules of the current project, or all rules of the current project and its dependent projects.
-
When you create a semantic query, for dates as well as for strings, only the “is” and “is not” constructs are valid. The following constructs are not available: “is before”, “is after”, “is between”, “contains”, “starts with”, and “ends with”.
-
Semantic queries run on the IRL code generated from the BAL rule. If a value translator is attached to a BOM member, the generated IRL uses this translation. Therefore, the semantic queries cannot find the BOM member because it is not shown in the IRL code.
may apply when
The predicate may apply when <a condition>
returns
all rules whose condition part could meet the query condition, or
the rules in which nothing in the rule condition contradicts the query
condition. This query can thus include rules with conditions that
are not specifically relevant to the query condition.
Example
Rule 1:
If the score of the borrower is at least 10 then...
Rule 2:
If the age of the borrower is at least 21 then...
Rule 3:
If the score of the borrower is less than 10 and the age of the borrower is more than 35 then...
Query 1:
Find all business rules such that each business rule may apply when [the score of the borrower is 20]
Query 2:
Find all business rules such that each business rule may apply when [the score of the borrower is 5]
Query 1 returns Rule 1 and Rule 2. It returns Rule 1 because if the borrower’s score is at least 10, then it could be 20. It returns Rule 2 because there is nothing in Rule 2 that specifically says that the condition could not hold: the borrower’s score could well be 20. It does not return Rule 3 because it contains a condition (score less than 10) that specifically indicates that the rule could not apply.
Query 2 returns Rule 2 and Rule 3. Rule 1 cannot apply because the query condition sets the score to below 10. In Rule 2, there is nothing that specifically stops the rule from being applicable when the score is 5. In Rule 3, at least one of the conditions could apply and there is nothing in the other condition that negates the fact that the score could be 5.
may become applicable when
The
predicate may become applicable
when <a condition>
is a more specific query that returns
only those rules in which the condition part could meet the query
condition. It does not return rules with conditions that are not specifically
relevant to the query condition. The query returns rules that would
be applicable if the query condition was true. For example, if a change
occurs in the elements of the rule condition, and the changed rule
condition matches the query condition.
Example
Rule 3:
If the category of the customer is Platinum then...
Rule 4:
If the category of the customer is not Platinum then...
Rule 6:
If the age of the customer is at most 65 and the category of the customer is not Platinum...
Query 1:
Find all business rules such that each business rule may become applicable when [the category of 'a customer' is Gold]
This query returns Rule 4 and Rule 6. It returns Rule 4 because if the category of the customer is not Platinum, it could be Gold. It returns Rule 6 for the same reason. The additional condition relating to the customer’s age does not contradict the condition in which the category can be Gold.
The query does not return Rule 3 because a rule that applies when the customer category is Platinum does not apply when the category is Gold. It does not return Rule 5 because the query looks for rules that could become applicable when the customer category is Gold, and the age of the customer is not relevant to this query. In other words, the condition of the rule cannot be affected by the fact that the customer’s category is Gold.
Query 2:
Find all business rules such that each business rule may become applicable when [the age of 'a customer' is at least 21]
This query does not return Rule 5 because it searches for rules that could “become” applicable when the customer's age is over 21. Rule 5 is applicable even if the customer's age is under 21. Therefore Rule 5 does not ”become” applicable, but it “remains” applicable even if the customer's age changes from under 21 to over 21.
may lead to a state where
The
predicate may lead to a state where <a
condition>
returns the rules that, when executed, could show
a result that meets the query condition. This query takes into account
both the condition and action parts of the rule. It filters rules
based on their effect. It does not, therefore, return rules that have
no influence on the query condition.
Example
Rule 7:
If the age of the borrower is at least 25 then set the credit score of the borrower to 60
Rule 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
Query:
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]
This query returns Rule 7 but not Rule 8 because, after the age of the borrower has been checked and the credit score set, only Rule 7 shows a result of over 50.
uses
the phrase
predicate, see uses the phrase.