Oracle® Fusion Middleware Decision Center User's Guide for Oracle Real-Time Decisions 11g Release 1 (11.1.1) Part Number E16631-03 |
|
|
PDF · Mobi · ePub |
There are three types of Rules:
Eligibility Rules are used to determine whether Choice Groups and Choices are eligible to participate in a Decision.
Filtering Rules are reusable components of decisions and other rules. They are used to segment population, so that performance metrics can be weighted more heavily for one segment than another.
Scoring Rules are used for scoring Choices Groups and Choices. The score is used by the Decision to determine the proper Choice.
This chapter contains the following topics:
As part of a Choice or Choice Group, the Eligibility Rule determines whether the Choice is eligible to participate in the Decision or logic that makes the Choice selection. Choice Groups and Choices are available in the Inline Service Navigator under Decision Process.
Choice Groups are identified by the following icon:
Choices are identified by the following icon:
An eligibility rule determines whether the sub-tree headed by a Choice Group is eligible for a decision. Note that even if Choices themselves are eligible, they will not be eligible unless all their parents are eligible.
Choice Group Eligibility Rules are accessed by selecting the Choice Group and then selecting Definition > Group Eligibility or Choice Eligibility.
Choice Eligibility Rules are accessed by selecting the Choice and then selecting Definition > Eligibility.
This section contains the following topics:
To add an eligibility rule, go to the Group Eligibility, Choice Eligibility, or Eligibility tab of the Choice or Choice Group, then add a new rule. See Section 4.5.3, "Adding Statements to Rules" for details of how to create rules and to add statements to them.
Note:
Rule modification is possible only if the Inline Service is opened for editing.
Choice Group rules and Choice rules are inherited and additive. That is, if there are rules at the Choice Group (Group and Choice rule) and rules at the Choice level, it is as if there is a logical AND extending the rules. The inherited rules are shown in an expandable section at the top of the rule labeled Inherited eligibility conditions. Use the up arrow and down arrow buttons to expand and collapse the sections.
Example 4-1 shows an example of how Choice Group rules and Choice rules are evaluated.
Example 4-1 Evaluating Choice Group Rules and Choice Rules
Group1 has rules GroupRule1 and ChoiceRule1 Group2 is a child of Group1 and has rules GroupRule2 and ChoiceRule2 Group2 has a Choice, Choice1, and it has a rule, Rule1
In this example, when evaluating the rules for Choice1, the following rules are invoked:
GroupRule1 AND GroupRule2 AND ChoiceRule1 AND ChoiceRule2 AND Rule1
When determining eligibility for a Choice, parent eligibility is tested first, to avoid the unnecessary evaluation of eligibility rules on Choices.
Example 4-2 shows an example of how eligibility is determined for a Choice.
Example 4-2 Determining Eligibility for a Choice
Group1 has rule GroupRule1 Group2 is a child of Group1 and has rule GroupRule2 Group2 has a Choice, Choice1, and it has a rule, Rule1
In this example, eligibility is determined in the following manner:
If Choice1 is eligible with Rule1 test with GroupRule2 if eligible test with GroupRule1
As standalone rules, filtering rules can be used to segment population or be used as components of other rules. Standalone rules are reusable by many different elements.Standalone filtering rules are accessed under Decision Process > Rules Library > Filtering Rules.
Filtering rules can be used by any other rule and also for decision priorities. In the latter case, filtering rules are assigned to a Decision to apply performance metrics to different segments of a population. Figure 4-1 shows a typical filtering rule used to segment population.
The scoring rule shown in Figure 4-1 targets customers over the age of 18 with a credit line amount over $8000. Filtering rules are used by Decisions.
To use a Filtering rule to segment population:
To add a new rule, click the filtering rule icon on the toolbar above the navigator. The filtering rule icon appears as follows:
Create a standalone filtering rule for segmentation.
See Section 4.5.3, "Adding Statements to Rules" for details of how to create rules and to add statements to them.
Select the Decision for which you want to segment population. Select Definition > Priorities.
In the editor, using Segment, select the filtering rule that defines the segment of population.
Optionally, you can adjust the weighting of the performance metrics for this segment.
Click the Save icon to save your changes.
One of the changes you can make to an Inline Service is to adjust the priorities of your business goals. The outcome of a decision is made based on the performance goals that are defined for your organization, the population segments that have been defined, and the prioritization of those goals for each segment of the population. Priorities can be adjusted on the Decision > Definition > Priorities subtab.
Note:
Rule modification is possible only if the Inline Service is opened for editing.
Figure 4-2 shows an example of priorities for business goals.
In the example shown in Figure 4-2, the population segment called Segment to Retain has the Customer Retention business goal heavily weighted in its favor (71%), while the remaining population has maximizing revenue as a priority (29%).
If there is a special circumstance or a change in population, you can adjust this prioritization by sliding the weighting bar. Once adjusted, you must redeploy your Inline Service and log in to Decision Center again to see your changes.
As opposed to eligibility rules that return Boolean values, scoring rules return numeric values. These values can be used throughout the Oracle RTD Decision logic. Typical use cases are:
Setting the score of a choice for a given performance goal
Setting the value for a choice attribute
Figure 4-3 shows an example of a scoring rule.
In the example shown in Figure 4-3, scores are assigned based on a customer's credit line amount. If a customer does not fit any of the credit line range categories, the score defaults to 3.
Rules are used for several purposes within Decision Studio and Decision Center, namely:
For determining the eligibility of Choice Groups and Choices to take part in a Decision
As standalone, reusable rules for filtering population segments
As standalone, reusable rules for scoring Choices
The editors that are used to create rules are very similar. The following sections describe how to create rules using these editors and the Rule Editor toolbar.
Note:
Rule modification is possible only if the Inline Service is opened for editing.
This section contains the following topics:
The Rule Editor toolbar provides access to features used to edit rules. This toolbar is sensitive to the context of the task you are performing.
From left to right, the toolbar functions are as follows:
Edit rule properties
Add conditional value
Add Rule
Add Rule Set
Delete
Invert
Move up
Move down
Copy
Cut
Paste
Oracle RTD has three types of rules:
Filtering rules
Scoring rules
Eligibility rules
An Oracle RTD rule consists of one of more rule conditions, with logical operators governing how the conditions are combined. These conditions are expressed in the form of rule statements, as described in the section.
Note:
This section describes rules that have conditions, that is, they are not always true.
The following is an example of a simple filtering rule, called Select List Rule, used to illustrate rule statements in this section:
Select List Rule is true when All of the following 1. session / customer / Age > 21 2. session / customer / MaritalStatus = "MARRIED"
Table 4-1 shows a more formal representation of the Oracle RTD rule grammar, using BNF (Backus-Naur Form)-type conventions, which describes the terms used in Oracle RTD rule statements.
Table 4-1 Oracle RTD Rule Grammar
Term | Term Component | Notes |
---|---|---|
|
|
None. |
|
|
Provides the name for the rule. After the rule is created, the header line is not editable. |
|
All of the following | Any of the following | None of the following | Not all of the following |
The logical operator controls the |
|
|
Rule entries are always numbered. They may contain boolean statements or other rule entries. |
|
|
The second |
|
|
The |
|
|
Used only for array-processing rule sets. See "Quantifiers and Array-Processing Rules" for details. |
|
For all | There exists |
None. |
The Select List Rule example can be categorized as follows:
Select List Rule is true when = <header line>
All of the following = <logical operator>
The remainder of the rule consists of a <rule entry>
made up of the following two statements:
session / customer / Age > 21 = <boolean statement>
session / customer / MaritalStatus = "MARRIED" = <boolean statement>
Rule Sets and Boolean Statements
A rule set (as denoted by <rule set>
in Table 4-1) is a composite statement, that consists of one or more numbered rule entries, each of which is either a boolean statement or another rule set.
A boolean statement (as denoted by <boolean statement>
in Table 4-1) contains a condition that evaluates to true or false when the rule is processed. The boolean statement is the lowest-level element of a rule set - it cannot be decomposed further.
You can optionally name the rule sets defined within higher-level rule sets.
Note:
Each Oracle RTD rule has an implicit, unnamed, top-level rule set.
Each rule set is qualified by a logical operator, which controls the processing of the rule set statements. See "Logical Operators" for more information.
The following Exclusion Rule example shows a rule set within a rule set.
In the example:
The top-level unnamed rule set contains the logical operator All of the following and two rule entries. The first rule entry is a boolean statement, the second rule entry is a rule set.
The rule set inside the top-level rule set contains the logical operator None of the following and three rule entries, each of which is a boolean statement.
Note:
Oracle RTD also supports rule sets that depend on values in an array. See "Quantifiers and Array-Processing Rules" for more details.
For rule sets which depend on values in an array, the rule set has an additional, overall "quantifier" expression (either For all or There exists). This quantifier qualifies the logical operator of the rule set. See "Quantifiers and Array-Processing Rules" for more information.
Logical Operators
The Oracle RTD logical operators are as follows:
All of the following (logical and). The rule set evaluates to true when all of its boolean statements and lower-level rule sets are satisfied.
Any of the following (logical or). The rule set evaluates to true when any one of its boolean statements or lower-level rule sets is true.
None of the following (logical not and). The rule set evaluates to true when all of its boolean statements and lower-level rule sets are false.
Not all of the following (logical not or). The rule set evaluates to true when any one of its boolean statements or lower-level rule sets is false.
Quantifiers and Array-Processing Rules
Rule sets may depend on values that occur in arrays, as follows:
Rule sets can evaluate elements of an array
An expression within a rule set can reference elements of an array
These types of rules are referred to as array-processing rules.
For these cases, there are rule sets where a "quantifier" expression - also referred to as a quantifier - qualifies the logical operator of the rule set. Either the statements of the rule set must be fulfilled for all array elements, or they must be fulfilled for at least one array element.
In the following example, a rule has been created which examines all of the agents contained in an array attribute, session/agents. In this example, the rule evaluates to true when all the agents are at least 30 years old and have a status of "Qualified."
Agent Rule is true when For all people in session/agents, All of the following 1. people / Age >= 30 2. people / Status = "Qualified"
Full details of the syntax of array-processing rules appear in the section following. In the preceding example, the term people
is an arbitrary term that is defined by the user and is used to identify individual array elements in the rule set.
Array-Processing Rule Qualification
The general formula for an array-processing rule qualification is:
<quantifier> <array_variable> in <array_name>, <logical_operator>
where:
quantifier
is one of the following: For all, There exists
For all. This quantifier, together with the rule set logical operator, specifies that each array element must be examined, and for each array element, all the boolean statements and lower-level rule sets in the qualified rule set must be fulfilled.
Rule evaluation will stop processing the array as soon as one array element is found where all the boolean statements and lower-level rule sets in the qualified rule set are not fulfilled. The rest of the elements in the array will be skipped.
There exists. This quantifier, together with the rule set logical operator, specifies that all the boolean statements and lower-level rule sets in the qualified rule set must be fulfilled for at least one array element.
Rule evaluation will stop processing the array as soon as one array element is found where all the boolean statements and lower-level rule sets in the qualified rule set are fulfilled. The rest of the elements in the array will be skipped.
array_variable
is an arbitrary name to identify individual array elements of the array array_name
in the boolean statements and lower-level rule sets in the qualified rule set
Notes:
The array_variable
can still be referenced in the boolean statements of lower-level rule sets that have their own specific array variables.
The array_variable
must be unique within the scope of the rule, that is, you cannot use the same array_variable
name as the array variable for a lower-level array-processing rule.
array_name
is the array to be examined
logical_operator
is one of the following: All of the following, Any of the following, None of the following, Not all of the following
As an example of an array-processing rule set, consider the two entities session and customer.
The session entity contains the following attributes:
The Integer attribute AgentDept
The array attribute CustInfo of type customer
The customer entity contains the following attributes:
The Integer attribute CompSize
The String attribute Region
You require a filtering rule to satisfy both of the following conditions:
The value of AgentDept must be 42.
For at least one customer in the CustInfo array, the CompSize must be > 100, and the Region must be "West."
The filtering rule could then be defined as follows (the array qualification expression is highlighted):
Cust Rule is true when
All of the following
1. session / AgentDept = 42
2. There exists some_customer in session / CustInfo, All of the following
1. some_customer / CompSize > 100
2. some_customer / Region = "West"
Add Rule Set
To add a rule set, click the Add Rule Set icon:
If this is the first element to be created in the rule, the following statements appear in the rule:
The default logical operator All of the following
A rule set entry as the numbered first line in the rule, which itself contains the default logical operator All of the following
An empty two-operand boolean statement within the newly-defined rule set
Otherwise, a new rule set entry is added as the next entry in the current rule set, containing an empty two-operand boolean statement. For example, when you add a rule set to an existing rule set that already contains one boolean statement, the added rule set entry appears beside the line number 2, as in the following:
You can name the rule set, by clicking the top right corner. When a rule set is named, you can collapse or expand the rule set, by clicking the appropriate chevron icon in the top right corner of the rule set box.
Add (Boolean Statement to) Rule
To add a boolean statement, click the Add Rule icon:
If this is the first element to be created in the rule, the default logical operator All of the following appears, followed by an empty two-operand boolean statement, as in the following:
Otherwise, an empty two-operand boolean statement is added to the current rule set, as in the following example, where one boolean statement already exists:
By default, boolean statements have two operands, with an intervening operator.
To switch between single and double operands in boolean statements, click the line number of the boolean statement, then click the arrowhead icon in the lower-right corner of the boolean statement box, as in the following example:
Single operands always evaluate to a Boolean.
Click the operator, then click the lower-right corner to select an operator:
Table 4-2 lists the available operators.
Table 4-2 Rule Operators
Operator | Description |
---|---|
none |
A simple expression that has only one operand |
= |
Left is equal to Right |
<> |
Left is not equal to Right |
< |
Left is less than Right |
<= |
Left is less than or equal to Right |
> |
Left is greater than Right |
>= |
Left is greater than or equal to Right |
in |
Left value is contained in a List on the Right side |
not in |
Left value is not contained in a List on the Right side |
includes all of |
Left list includes all the values of the Right list |
excludes all of |
Left list contains none of the values of the Right list |
includes any of |
Left list includes any one of the values of the Right list |
does not include all of |
Left list does not include all of the values of the list on the Right |
To edit the boolean statements of a rule, click the left side, then click the ellipsis. You can choose from a constant, attribute, or function call. Select Array at the top of the page to specify an array value.
Note:
Use of the Esc key at any time in an operand dialog will close the dialog.
If you choose Constant, provide the Data type and a Value for the item. If you selected Array, add as many items to the array as needed. Then, for each item, choose a Data Type and provide a Value.
If you choose Attribute, provide one of the following:
Group attribute: Attributes that are part of the Choice Group or its Choices that is selected in the Properties of the rule.
Session attribute: Attributes that are part of the Session entity.
Application attribute: Attributes that are a member of the Application element.
Array variable: Names used to identify individual array elements for rule sets within a quantified logical operator expression. See "Quantifiers and Array-Processing Rules" for more information.
Optionally, select Apply filter type and choose a Data type to filter the attributes by type. If you have selected Array, add as many items to the array as needed, then assign an attribute value for each.
If you choose Function call, provide one of the following:
Filtering rules: Standalone filtering rules defined for the Inline Service.
Scoring rules: Standalone scoring rules defined for the Inline Service.
Function calls: Standalone functions defined for the Inline Service.
Optionally, select Apply filter type and choose a Data type to filter the attributes by type. If you have selected Array, add as many items to the array as needed, then assign a function or rule for each.
When you select a type-restricted object for an operand or part of an operand, you may view values from a dropdown list of values for the other operand. You may select a value from this dropdown list, but you do not have to.
For more information about type restrictions and type-restricted objects, see the topic "About Type Restrictions" in Oracle Fusion Middleware Platform Developer's Guide for Oracle Real-Time Decisions.
Both Filtering and Scoring rules have rule properties that can be set. To edit rule properties, click the Rule properties icon:
Edit rule properties appears.
Rule properties include call templates and negative call templates. Call templates provide a user-friendly way to describe how to call a rule from another rule.
To define a call template, add the number of parameters for the rule by clicking the Add button under Parameters. Using {0}, {1}, and so on as arguments, and phrasing to describe the rule, define the template for call. It is important to use good phrasing, as this is what will be shown when using the rule.
For instance, a rule that checks if there were at least x calls from the user in the last y days could be phrased as follows:
There were at least {0} calls in the last {1} days
The negative call template is used when a rule is inverted, and should express the opposite. For example:
There were less than {0} calls in the last {1} days
Rule properties also let you assign which Choice Group to use with the rule. By selecting Use with choice group, you can specify which Choice Group or its Choices will provide the Choice attributes for use by parameters. These attributes will be available when you edit the value of an operand.
Use the Invert icon to invert different elements of a rule. By selecting the number of a boolean statement, you can invert the operator of the boolean statement. For instance, if the operand was =, it will be inverted to <>.
Logical operators for a rule set can also be inverted. To do this, select the logical operator and click Invert. For instance, All of the following becomes Not all of the following.
The final use for Invert is to invert a Boolean, or single operand, rule. When this type of rule is inverted, it is transformed to the negative call template of the function that defines the rule.
To change the order of rules and rule sets within a rule:
Select the rule entry by clicking its number.
Use the following operations from the Rule Editor toolbar to move rule entries:
Delete
Copy selection to clipboard
Cut selection to clipboard
Move up
Move down
See Section 4.5.1, "About the Rule Editor Toolbar" for information about the Rule Editor toolbar icons.
Click the Save icon to save your changes.