Contents
This is part of 1Z0-451: Oracle SOA Foundation Practitioner Exam
<< Previous
Explain business rules concepts
* See Overview of Oracle Business Rules
What Are Business Rules (BRs)
* BRs are statements that describe
– business policies
– key business decisions
* BRs allow continuous changes without code recompiling (vs Coding)
Rules Expressions
Rules can be expressed with two types:
* IF THEN structure (condition and actions)
* Decision table (spreadsheet like)
Conditions
* IF part of IF THEN structure
* Refers to facts, e.g.
IF Rental_application.driver age < 21
Actions
* THEN part of IF THEN structure
* Actions can
– CRUD facts
* Actions are fired sequentially, not in parallel
Rules Elements
Facts
* Facts are objects that rules reason on
* Each fact is an instance of fact type
* Fact types can be imported using Rules Designer from
– Java classes
– XML schema
– ADF-BC view objects
– Oracle RL definitions
Properties
* Properties have:
– Name
– Data type
– Value
Bucketsets
* A bucketset defines a list of values or a range of values of specific type
* Can be associated with fact properties in rules or decision tables
Rulesets
* Are containers for rules and decision tables, acting like namespaces or Java packages
* Ruleset = Rules + decision tables
Decision Functions
* Provide contracts or interfaces for invoking rules from Java or SOA
* Consist of
– Input fact types
– Rulesets to run
– Output fact types
Decision Points
* Rules SDK provides decision point API to access and run rules or decision tables from Java applications
Dictionaries
* Dictionaries are containers for
– facts
– functions
– globals
– bucketsets
– links
– decision functions
– rulesets
* Dictionary = Facts + Bucketsets + Rulesets
* A dictionary is an XML file (with .rules extension) that stores applications
– rulesets
– data model
* A dictionary can link to other dictionaries
* Dictionary example:
<?xml version="1.0"?> <RuleDictionary id="G}7dc19c2e:1381608dc2e:-7c2d" xmlns="http://xmlns.oracle.com/rules/dictionary"> <Name>ManualApproval</Name> ... <Package>poprocessing2</Package> <Version>11.1.1.0.0</Version> <DataModel id="L}2"> <JaxbFactType id="J}com.globalcompany.ns.orderbooking.rules.Price"> <Name>com.globalcompany.ns.orderbooking.rules.Price</Name> <Property id="J}com.globalcompany.ns.orderbooking.rules.Price.{price}"> <Name>price</Name> ... </Property> <Method id="J}public double com.globalcompany.ns.orderbooking.rules.Price.getPrice()"> <Name>getPrice</Name> ... </Method> ... <EnumBucketSetID>B}nil</EnumBucketSetID> </JaxbFactType> ... <DecisionFunction id="G}7dc19c2e:1381608dc2e:-7c26"> <Name>ManualApproval_DecisionService_1</Name> <DecisionFunctionInput id="L}45"> <Name>price</Name> ... </DecisionFunctionInput> <DecisionFunctionRuleSet id="L}44"> ... </DecisionFunctionRuleSet> <DecisionFunctionOutput id="L}46"> <Name>discountandshipping</Name> ... </DecisionFunctionOutput> </DecisionFunction> </DataModel> <RuleSet id="G}7dc19c2e:1381608dc2e:-7c27"> <Name>Ruleset1</Name> <Rule id="G}7dc19c2e:1381608dc2e:-7c24"> <Name>Rule1</Name> <Pattern id="L}47"> ... </Pattern> ... <Action id="L}53"> <Form>Assert New</Form> <Target>discountandshipping</Target> <ResolvedTarget>`J}public com.globalcompany.ns.orderbooking.rules.Discountandshipping()`</ResolvedTarget> <Expression id="L}54"> <Value>true</Value> </Expression> <Expression id="L}55"> ... </Expression> </Action> </Rule> <Rule id="G}7dc19c2e:1381608dc2e:-7c23"> <Name>Rule2</Name> ... </Rule> </RuleSet> </RuleDictionary>
Design Time and Run Time Elements
* Design time:
– BR Service Component: used in SOA
– Rules SDK: used in Java
* Run time:
– SOA Composer Application: used to edit deployed rules dictionaries.
Business Rule Service Component
* aka Decision Component
* Supports the use of Oracle Business Rules in a SOA composite application.
* Can be used within SOA composite to
– Run business rules
– Wire a BPEL component to BRs
– Dynamic routing in Mediator
– Advanced routing rules in Human Workflow
* Initiated by a BPEL process service component
* Rules are store in MDS
Describe the Oracle Business Rules architecture
Describe Oracle Rules Engine
Rules Engine Architecture
* Contains
– Rule-base
– Working memory
– Inference engine (RETE)
* Is a forward-chaining rules-based system:
– Facts cause rules to fire and firing rules can create more facts, which in turn can fire more rules.
– This process is called an inference cycle.
* Rules session:
Create rules with the Jdeveloper Rules Designer
* See this hands on tutorial
* See official documentation here
Integrate a simple rule with a BPEL Process
* See this hands on tutorial
* See official documentation here
Next >> Secure services and Composite Applications
References
* User’s Guide for Oracle Business Rules11g Release 1 (11.1.1.4.0)
*Using the Business Rules Service Component
* SOA 11g Tutorial: Business Rules