Skip Headers
Oracle® Fusion Middleware Decision Center User's Guide for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

Part Number E16631-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
PDF · Mobi · ePub

4 About Rules

There are three types of Rules:

This chapter contains the following topics:

4.1 About Eligibility Rules

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:

A fuzzy blue circle that contains a white checkmark.

Choices are identified by the following icon:

A blue circle that contains a white checkmark.

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:

4.1.1 Adding Eligibility Rules

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.

4.1.2 Evaluating Choice Group Rules and Choice Rules

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

4.1.3 Determining Eligibility

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

4.2 About Filtering Rules

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.

4.2.1 Using Filtering Rules to Segment Population

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.

Figure 4-1 Filtering Rule

Description of Figure 4-1 follows
Description of "Figure 4-1 Filtering Rule"

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:

  1. To add a new rule, click the filtering rule icon on the toolbar above the navigator. The filtering rule icon appears as follows:

    A green circle with a white e symbol and a gold plus sign.
  2. 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.

  3. Select the Decision for which you want to segment population. Select Definition > Priorities.

  4. In the editor, using Segment, select the filtering rule that defines the segment of population.

  5. Optionally, you can adjust the weighting of the performance metrics for this segment.

  6. Click the Save icon to save your changes.

4.3 Adjusting the Priorities of Business Goals by Population Segment

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.

Figure 4-2 Priorities for Business Goals

Description of Figure 4-2 follows
Description of "Figure 4-2 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.

4.4 About Scoring Rules

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:

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.

4.5 Working with Rules

Rules are used for several purposes within Decision Studio and Decision Center, namely:

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:

4.5.1 About the Rule Editor Toolbar

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.

Figure 4-4 Rule Editor Toolbar

Description of Figure 4-4 follows
Description of "Figure 4-4 Rule Editor Toolbar"

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

4.5.2 Oracle RTD Rule Terms and Statements

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

<rtd rule>

<header line> <logical operator> <rule entry>+ |

<header line> <array operator> <logical operator> <rule entry>+

None.

<header line>

<rule name> is true when

Provides the name for the rule.

After the rule is created, the header line is not editable.

<logical operator>

All of the following | Any of the following |

None of the following | Not all of the following

The logical operator controls the <rule entry> immediately following. The logical operator All of the following is the default logical operator when you initially create a rule.

<rule entry>

<boolean statement> | <rule set>

Rule entries are always numbered. They may contain boolean statements or other rule entries.

<rule set>

<logical operator> <rule entry>+ |

<array operator> <logical operator> <rule entry>+

The second <rule set> component option is known as an array-processing rule set.

<boolean statement>

<boolean> |

<boolean function> |

<left operand> <relational operator> <right operand>

The <boolean statement> is the lowest level of a rule set - it cannot be decomposed further.

<array operator>

<quantifier> <array variable> in <array name>,

Used only for array-processing rule sets. See "Quantifiers and Array-Processing Rules" for details.

<quantifier>

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.

Surrounding text describes rule_sets1.gif.

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:

  1. The array_variable can still be referenced in the boolean statements of lower-level rule sets that have their own specific array variables.

  2. 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"
    

4.5.3 Adding Statements to Rules

Add Rule Set

To add a rule set, click the Add Rule Set icon:

A plus sign, a dot, and a dash.

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

Surrounding text describes sr_new_rule_set_entry.gif.

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:

Surrounding text describes new_rs2.gif.

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:

A plus sign, a dot, and a dash.

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:

Surrounding text describes new_rule0.gif.

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:

Surrounding text describes new_rule1.gif.

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:

Surrounding text describes single_double.gif.

Single operands always evaluate to a Boolean.

4.5.4 Selecting an Operator

Click the operator, then click the lower-right corner to select an operator:

An operator and a triangle in the lower right corner.

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


4.5.5 Editing Boolean Statements

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.

4.5.5.1 Using Type-Restricted Objects in Rules

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.

4.5.6 Editing Rule Properties

Both Filtering and Scoring rules have rule properties that can be set. To edit rule properties, click the Rule properties icon:

A hand pointing to a bulleted item on a page.

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.

4.5.7 Inverting Rule Elements

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.

4.5.8 Moving Rules and Rule Sets

To change the order of rules and rule sets within a rule:

  1. Select the rule entry by clicking its number.

  2. 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.

  3. Click the Save icon to save your changes.