How to Add Rules How to Define a Test in a Rule
4.3.1 How to Add Rules
To create a rule you first add the rule to a ruleset, and then you insert tests and actions. The actions are associated with pattern matches. At runtime when a test in the IF area of a rule matches, the Rules Engine activates the THEN action and prepares to run the actions associated with the rule. Rules Designer lets you create a rule where by default the rule fires for each matching fact. To enable other options, where the same fact type matches more than once, or never, you select Advanced Mode. For more information on advanced mode and showing advanced settings, see Section 4.5, Using Advanced Settings with Rules and Decision Tables . To add rules in a ruleset: 1. In Rules Designer, select a ruleset from the Rulesets navigation tab. 2. In the View field, select IFTHEN Rules. 3. Click Add to add a rule. For example, click Add to add a rule named Rule_1, as shown in Figure 4–8 . Figure 4–8 Adding a Rule in a Ruleset4.3.2 How to Define a Test in a Rule
To create a test in a rule you add conditions for facts. For example, with a sample CustomerOrder fact with an annual spending property, you can add a test to 4-8 Oracle Fusion Middleware Users Guide for Oracle Business Rules determine if a customer order is associated with a high value of spending, based on the annual spending for the customer. Note that you can use bucketsets to limit the values for tests and actions in rules. For more information, see Section 4.11, Using Bucketsets as Constraints for Options Values in Rules . Figure 4–9 shows this sample rule. Figure 4–9 Adding a Test to a Rule At runtime, when this rule is processed the Rules Engine checks the facts against rule pattern tests that you define to find matching facts. For this sample rule, Rule_1, when a fact matches the Rules Engine modifies the fact and then modifies the value property to High. To define tests in rules: 1. In Rules Designer, select a ruleset from the Rulesets navigation tab. 2. In the View field, select IFTHEN Rules this is the Rules Designer default. 3. Add or select the rule you want to use, for example, select Rule_1. 4. In Rule_1, in the IF area, select insert test. 5. For a test, the IF area of a rule includes a left-hand-side operand and a right-hand-side operand, as shown in Figure 4–10 . Figure 4–10 Rule Test with Left-hand-side operand and Right-hand-side operand 6. In a test, you replace the left-hand-side operand with a value. To do this, select the left-hand-side operand. This displays a text entry area and a list, as shown in Figure 4–11 : Working with Rulesets and Rules 4-9 Figure 4–11 Configuring the Left-hand-side Operand of a Test in a Rulea. To enter a value use the list to select an item from the value options.
Parts
» Oracle Fusion Middleware Online Documentation Library
» What Are Rule Conditions? What Are Rule Actions?
» What Are Decision Tables? What Are Facts and Bucketsets? What Are Rulesets?
» Oracle Business Rules SDK Rules Designer
» Declarative Rules The RETE Algorithm
» How to Display and Edit XML Facts How to Reload XML Facts with Updated Schema
» What You Need to Know About XML Facts
» How to Display and Edit Java Facts What You Need to Know About Java Facts
» What You Need to Know About List of Values Bucketsets What You Need to Know About Range Bucketsets
» What You Need to Know About Bucketset Allowed in Actions Option
» In the Filter Query field, click insert test to insert a default test as
» How to Add Rules How to Define a Test in a Rule
» What You Need to Know About Advanced Mode Rules
» Introduction to Tree Mode Rules
» What You Need to Know About Tree Mode Rules
» How to Use Bucketsets to Provide Options for Test Expressions
» From the list next to the Add icon, select Rule.
» Introduction to Decision Table Operations
» Introduction to Decision Point API How to Obtain the Car Rental Sample Application
» How to Create Data Model Elements for Use with a Decision Point
» How to Add a Decision Point Using Decision Point Builder
» How to Create and Use Decision Point Instances
» What You Need to Know About Decision Point and Decision Tracing
» Testing Oracle Business Rules at Runtime Introduction to the Grades Sample Application
» Enter a name and test score and click Submit. This returns results as shown in
» Understanding Oracle Business Rules ADF Business Components Fact Types
» Understanding Oracle Business Rules Decision Point Action Type
» How to Call a Decision Point with ADF Business Components Facts
» How to Call a Decision Function with Java Decision Point Interface
» What You Need to Know About Decision Function Configuration with ADF Business Components
» How to Add the Outside Manager Finder Class
» How to Update ADF META INF for Local Dictionary Access
» How to Add the Employee Raises Java Class
» Working with Decision Component Metadata
» Introduction to Decision Components Decision Service Architecture
» Working with Advanced Mode Options
» Expression Builder Condition Browser
» Editing Decision Table Cells
» Understanding the Validation Panel Updating the Validation Panel
Show more