24 Getting Started with Oracle Business Rules

This chapter describes how to use a business rule service component to integrate a SOA composite application with Oracle Business Rules. A business rule service component is also called a Decision component. You can add business rules as part of an SCA application or as part of a BPEL process.

This chapter includes the following sections:

For more examples of using Oracle Business Rules, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.1 Introduction to the Business Rule Service Component

A Decision component, also called a business rule service component, supports use of Oracle Business Rules in a SOA composite application. Decision components support the following SOA composite usage:

24.1.1 Integrating BPEL Processes, Business Rules, and Human Tasks

You can create a SOA composite application that includes BPEL process, business rule, and human task service components. These components are complementary technologies. BPEL processes focus on the orchestration of systems, services, and people. Business rules focus on decision making and policies. Human tasks enable you to model a workflow that describes the tasks for users or groups to perform as part of an end-to-end business process flow.

Some examples of where business rules can be used include:

  • Dynamic processing

    Rules can perform intelligent routing within the business process based on service level agreements or other guidelines. For example, if the customer requires a response within one day, send a loan application to the QuickLoan loan agency only. If the customer can wait longer, then route the request to three different loan agencies.

  • Externalize business rules in the process

    There are typically many conditions that must be evaluated as part of a business process. However, the parameters to these conditions can be changed independently of the process. For example, you provide loans only to customers with a credit score of at least 650. This value may be changed dynamically based on new guidelines set by business analysts.

  • Data validation and constraint checks

    Rules can validate input documents or apply additional constraints on requests. For example, a new customer request must always be accompanied with an employment verification letter and bank account details.

  • Human task routing

    Rules are frequently used for human tasks in the business process:

    • Policy-based task assignments dispatch tasks to specific roles or users. For example, a process that handles incoming requests from a portal can route loan requests and insurance quotes to a different set of roles.

    • Load balancing of tasks among users. When a task is assigned to a set of users or a role, each user in that role acquires a set of tasks and acts on them in a specified time. For new incoming tasks, policies may be applied to set priorities on the task and put them in specific user queues. For example, a specific loan agent is assigned a maximum of 10 loans at any time.

For more information about creating business rules in the Human Task editor of a human task component, see Section 27.3.7.2, "Specifying Advanced Task Routing Using Business Rules."

24.2 Overview of Rules Designer Editor Environment

You can create a business rules service component in the SOA composite application of Oracle JDeveloper and then design it by using the Business Rules Designer, which is displayed when you double-click a business rule in the SOA Composite Editor.

The Business Rules Designer consists of the following main sections shown in Figure 24-1. These sections enable you to work with business rules in Oracle JDeveloper.

Figure 24-1 Rules Designer in Oracle JDeveloper

Description of Figure 24-1 follows
Description of "Figure 24-1 Rules Designer in Oracle JDeveloper"

24.2.1 Application Navigator

The Application Navigator displays the files in the project. Each project can only contain one composite. But each composite can have multiple components of either the same type or different types (Business Rules, BPEL process, Oracle Mediator, and human workflow).

As you design business rules, additional files, folders, and elements can appear in the Application Navigator.

24.2.2 Rules Designer Window

The Rules Designer window provides a visual view of the selected dictionary component. You use the Rules Designer navigation tabs to select different parts of the dictionary with which to work. The rules designer window displays when you perform one of the following actions:

  • In a composite, double-click a Business Rule component.

  • Double-click the Business Rule component in the SOA Composite Editor.

  • In a BPEL process, double click a business rule.

  • In the Application Navigator, double-click a business rules dictionary file (a file with the .rules extension)

  • Click the Design tab with a .rules file selected.

Table 24-1 describes where you can find information about working with a dictionary with Rules Designer.

Table 24-1 Rules Designer Navigation Areas Descriptions

Rules Designer Navigation Tab Description

Facts

Facts are the objects that rules reason on.

Functions

A function, in Oracle Business Rules, refers to the standard mathematical functions.

Globals

A global, in Oracle Business Rules, is similar to a public static variable in Java.

Bucketsets

Bucketsets define the data types of fact properties.

Links

Links are used to link to a dictionary in the same application or in another application.

Decision Functions

A Decision Function is a function that is configured declaratively, without using RL Language programming.

Rulesets with Rules and Decision Tables

A ruleset provides a unit of execution for rules and for Decision Tables. A Decision Table provides a mechanism for describing data processing tasks.


For more information about the Rules Designer navigation areas and its descriptions, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.2.3 Structure Window

The Structure window offers a structural view of the data in the Business Rule dictionary currently selected in the Rules Designer window. You can perform a variety of tasks from this section, by selecting an element and right-clicking on the element, including:

  • Managing (creating, editing, refreshing, and deleting) elements such as facts, functions, globals, bucketsets, dictionary links, and decision functions

  • Accessing rulesets, rules, and Decision Tables

Figure 24-2 shows the Structure window.

Figure 24-2 Structure Window with Rules Designer Dictionary

Structure Window with Rules Designer Dictionary
Description of "Figure 24-2 Structure Window with Rules Designer Dictionary"

24.2.4 Business Rule Validation Log Window

Rules Designer displays the status of dictionary validation in the business rule validation log, as shown in Figure 24-3.

When a dictionary is invalid, Rules Designer produces a list of warning messages and lists the associated dictionary objects that you can use to locate the dictionary object and to correct the problem. You can safely ignore the validation warnings that you see when you create rules using Rules Designer. The validation warnings are removed as you create the rules, but are shown during the intermediate steps. To test or deploy rules, the associated dictionary must not display warnings.

For more information on business rules validation, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

Figure 24-3 Rules Designer Business Rule Validation Log

Rules Designer Business Rule Validation Log
Description of "Figure 24-3 Rules Designer Business Rule Validation Log"

24.3 Introduction to Creating and Editing Business Rules

This section describes how to get started with business rules and provides a brief introduction to the main sections of Oracle JDeveloper that you use to design business rules.

24.3.1 How to Create Business Rules Components

You can add Business Rule components using the SOA Composite Editor.

To create a Business Rule component:

  1. Follow the instructions in Table 24-2 to start Oracle JDeveloper.

    Table 24-2 Starting Oracle JDeveloper

    To Start... On Windows... On UNIX...

    Oracle JDeveloper

    Click JDev_Oracle_Home\JDev\bin\jdev.exe or create a shortcut

    $ORACLE_HOME/jdev/bin/jdev


  2. Create a Business Rule service component through one of the following methods:

    As a service component in an existing SOA composite application:

    1. From the Component Palette, drag a Business Rule service component into the SOA Composite Editor.

    In a new application:

    1. From the Application Navigator, select File > New > Applications > SOA Application.

      This starts the Create SOA Application wizard.

    2. In the Name your application page, enter an application name in the Name field.

    3. In the Directory field, enter a directory path in which to create the SOA composite application and project.

    4. Click Next.

    5. In the Name your project page, enter a unique project name in the Project Name field. The project name must be unique across SOA composite applications. This is because the uniqueness of a composite is determined by its project name. For example, do not perform the actions described in Table 24-3.

      Table 24-3 Restrictions on Naming a SOA Project

      Create an Application Named... With a SOA Project Named...

      Application1

      Project1

      Application2

      Project1


      During deployment, the second deployed project (composite) overwrites the first deployed project (composite).

    6. Click Next.

    7. In the Configure SOA settings page, select Composite with Business Rule.

    8. Click Finish.

    Each method causes the Create Business Rules dialog shown in Figure 24-4 to appear.

    Figure 24-4 Create Business Rules Dialog

    Description of Figure 24-4 follows
    Description of "Figure 24-4 Create Business Rules Dialog"

  3. Provide the required details. For more information on providing Inputs and Outputs and on using the Import Dictionary option with this dialog, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

  4. Click OK.

24.3.2 Introduction to Working with Business Rules in Rules Designer

When you are working with business rules Oracle JDeveloper displays Rules Designer.

24.4 Adding Business Rules to a BPEL Process

You can use a Decision component, also called a business rule service component, to execute business rules in a BPEL process.

24.4.1 How to Add Business Rules to a BPEL Process

You add business rules to a BPEL process using a Business Rule component. When you add a business rule component to a BPEL process, you must include input and output variables to provide input to the rules and obtain results back from the business rules.

A business rule component enables you to execute business rules and make business decisions based on the rules. To create a business rule component, also called a Decision component, you drag-and-drop a Business Rule from the component palette into the BPEL process.

To add a business rule to a BPEL process:

  1. Create a BPEL process service component. For more information, see Section 4.1, "Introduction to the BPEL Process Service Component."

  2. Expand the BPEL process by double-clicking the process item. For example, expand the BPEL process to view receiveInput and callbackClient as shown in Figure 24-5.

    Figure 24-5 Adding A Business Rule to a BPEL Process

    Description of Figure 24-5 follows
    Description of "Figure 24-5 Adding A Business Rule to a BPEL Process"

  3. Select Business Rule from the SOA Components section of the Component Palette and drag-and-drop a Business Rule into the position where the business rules are needed. For example, drag-and-drop a Business Rule between receiveInput and callbackClient, as shown in Figure 24-6.

    Figure 24-6 Drag-and-drop a Business Rule into a BPEL Process

    Description of Figure 24-6 follows
    Description of "Figure 24-6 Drag-and-drop a Business Rule into a BPEL Process"

  4. Oracle JDeveloper displays the business rule in the diagram. Double-click the business rule component to display the Rule dialog box. The Rule dialog box provides tabs, such as General, Dictionary, Correlation Sets, and so on, where you can select an existing Oracle Business Rules dictionary or enter the name of a new dictionary to create. Under the General tab, in the Name field enter a name for the business rule. For example, enter GetCreditRating, as shown in Figure 24-7. If you previously created a dictionary, under the Dictionary tab, in the Dictionary field, select an existing dictionary.

    Figure 24-7 Business Rule Added to Auto Loan BPEL Process

    Description of Figure 24-7 follows
    Description of "Figure 24-7 Business Rule Added to Auto Loan BPEL Process"

  5. In the Business Rule area for the Business Rule Dictionary, click the Create Dictionary icon to display the Create Business Rules dialog.

  6. In the Create Business Rules dialog you do the following:

    • Specify a name for the Oracle Business Rules dictionary and a package name.

    • Specify the input and output data elements for the business rule. For example, for a sample Decision component named GetCreditRating, the input is a rating request document. The output is generated when you run the business rules, and for this example is a rating document. For example, in BPEL you can create two new variables, RatingRequest and Rating that carry the input and output data for the GetCreditRating rules.

    Enter a name for the Oracle Business Rules dictionary. For example, enter GetCreditRating, as shown in Figure 24-8.

    Figure 24-8 Adding GetCreditRating Business Rule Dictionary

    Description of Figure 24-8 follows
    Description of "Figure 24-8 Adding GetCreditRating Business Rule Dictionary"

Add inputs for business rule:

  1. In the Create Business Rules dialog, from the menu next to the Add icon select Add Input Variable... to create the input variable.

    This displays the Add Input Variable dialog box.

  2. In the Add Input Variable dialog box, expand the Process folder and select the Variables folder immediately inside the Process.

  3. Right-click the Variables folder, and from the list select Create Variable... as shown in Figure 24-9.

    Figure 24-9 Add Input Variable

    Description of Figure 24-9 follows
    Description of "Figure 24-9 Add Input Variable"

    This displays the Create Variable dialog box.

  4. In the Create Variable dialog box, in the Name field enter a value. For example, enter RatingRequest as shown in Figure 24-10.

    Figure 24-10 Create Variable Dialog

    Description of Figure 24-10 follows
    Description of "Figure 24-10 Create Variable Dialog"

  5. In the Create Variable Type area click the Browse Elements icon. Use the navigator to locate the schema element type for the input variable. For example, select the ratingrequest type. Add any needed types using the Type Chooser.

  6. Click the Import Schema File icon to import the schema. For example, import CreditRatingTypes.xsd. Also import any other required schema for your application.

  7. In the Type Chooser dialog, select ratingrequest and click OK.

  8. In the Create Variable dialog, click OK.

  9. In the Add Input Variable dialog, click OK.

Add outputs for business rule:

  1. In the Create Business Rules dialog, from the dropdown menu next to the Add icon, select Add Output Variable.... This displays the Add Output Variable dialog. Use this dialog to create an output variable. For example, create an output variable for GetCreditRating in the same way you created the input variable.

  2. In the Add Output Variable dialog select the scope by selecting the Variables folder under Process.

  3. Right-click and from the dropdown list select Create Variable.... This displays the Create Variable dialog.

  4. In the Create Variable dialog, in the Name field enter the output variable name. For example enter Rating.

  5. In the Create Variable dialog, in the Type area select the Browse elements icon and use the Type Chooser dialog to enter the type for the output variable. For example, expand the CreditRatingTypes.xsd and select the element type rating.

  6. In the Type Chooser dialog, click OK.

  7. In the Create Variable dialog, click OK.

  8. In the Add Output Variable dialog, click OK.

    This displays the Create Business Rules dialog, as shown in Figure 24-11.

    Figure 24-11 Create Business Rules Dialog with Input and Output Variables

    Description of Figure 24-11 follows
    Description of "Figure 24-11 Create Business Rules Dialog with Input and Output Variables"

Set options and create decision service and business rules dictionary:

  1. If you do not want to use the default service name, then select the Advanced tab and in the Service Name field enter the service name. For example enter the service name CreditRatingService.

  2. Determine if the Decision Component is stateful or stateless with Reset Session. For more information, see Section 24.4.5, "What You May Need to Know About Decision Component Stateful Operation".

  3. In the Create Business Rules dialog, click OK. Oracle JDeveloper creates the Decision component and the dictionary and displays Rules Designer, as shown in Figure 24-12.

Figure 24-12 Rules Designer Canvas Where You Work with Business Rules

Description of Figure 24-12 follows
Description of "Figure 24-12 Rules Designer Canvas Where You Work with Business Rules"

For information on Rules Designer, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.4.2 What Happens When You Add Business Rules to a BPEL Process

When you add business rules to a BPEL process, Oracle JDeveloper creates a Decision component to control and run the business rules using the Business Rule Service Engine.

A Decision component consists of the following:

  • Rules or Decision Tables that are evaluated using the Rules Engine. These are defined using Rules Designer and stored in a business rules dictionary.

  • A description of the facts required for specific rules to be evaluated and the decision function to call. Each ruleset that contains rules or Decision Tables is exposed as a service with facts that are input and output, and the name of an Oracle Business Rules decision function. The facts are exposed through XSD definitions when you define the inputs and outputs for the business rule. A Decision function is stored in an Oracle Business Rules dictionary. For more information, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

  • A web service wraps the input, output, and the call to the underlying Business Rule service engine.

    This web service lets business processes assert and retract facts as part of the process. In some cases, all facts can be asserted from the business process as one unit. In other cases, the business process can incrementally assert facts and eventually consult the rule engine for inferences. Therefore, the service supports both stateless and stateful interactions.

    You can create a variety of such Decision components.

    For more information, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.4.3 What Happens When You Create a Business Rules Dictionary

After you create an application, a project, and a rules dictionary, the rules dictionary appears in the structure pane in Oracle JDeveloper and Rules Designer opens in the main canvas.

As part of the create Business Rule dialog you either select an existing dictionary or a new rule dictionary is created with the following pre-loaded data:

  • XML fact type model based on the input and output information of the Business Rule.

  • A Ruleset that must be completed by adding rules or Decision Tables. With an existing dictionary, you use the import option to specify a dictionary that may already contain the rules or Decision Tables.

  • A service component with the input and output contract of the Decision component.

  • A Decision component for the rule dictionary and wires to the BPEL process.

Note:

When you create inputs and outputs for a business rule, the XML fact type that is created in the associated dictionary is named based on the schema types for the inputs and outputs that you supply in the Create Business Rules dialog. When you specify schema type for the input and the output, Rules Designer defines fact types and aliases associated with your type selections for input and output. If you only use a single type for both the input and the output, then the Decision component creates a single fact that is shown in the Rules Designer Facts tab. This fact represents the fact type you specified and uses an alias name that is a concatenation of both the input variable name and the output variable name. In Rules Designer you can rename this alias if you do not like the default naming scheme for the fact type.

24.4.4 What You May Need to Know About Invoking Business Rules in a BPEL Process

When you add business rules to a BPEL process Oracle JDeveloper creates a Decision Service that supports calling Oracle Business Rules with the inputs you supply, and returning the outputs with results. The Decision Service provides access to Oracle Business Rules Engine at runtime as a web service. For more information, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.4.5 What You May Need to Know About Decision Component Stateful Operation

A Decision Component running in a business rules service engine supports either stateful or stateless operation. The Reset Session checkbox in the Create Business Rules dialog provides support for these two modes of operation.

By default the Reset Session checkbox is selected which indicates stateless operation. Stateless operation means that, at runtime, the rule session is released after the Decision Component invocation.

When Reset Session is unselected, the underlying Oracle Business Rules object is kept in the memory of the business rules service engine at a separate location (so that it is not given back to the Rule Session Pool when the operation is finished). A subsequent use of the Decision component re-uses the cached RuleSession object, with all its state information from the callFunctionStateful invocation, and then releases it back to the Rule Session pool after the callFunctionStateless operation is finished. Thus, when Reset Session is unselected the rule session is saved for a subsequent request and a sequence of Decision Service invocations from the same BPEL process should always end with a stateless invocation.

24.5 Adding Business Rules to a SOA Composite Application

To work with Oracle Business Rules in a SOA composite application, you create an application and add business rules.

The business rule service component enables you to integrate your SOA composite application with business rules. This creates a business rule dictionary and enables you to execute business rules and make business decisions based on the rules.

After creating a project in Oracle JDeveloper, you must create a Business Rule Service component within the project. When you add a business rule you can create input and output variables to provide input to the service component and to obtain results from the service component.

To use business rules with Oracle JDeveloper, you do the following:

  • Add a business rules service component

  • Create input and output variables for the service component

  • Create an Oracle Business Rules dictionary

24.5.1 How to Add Business Rules to a SOA Composite Application

To work with Oracle Business Rules in a SOA composite application you use Oracle JDeveloper to create an application, a project, and then add a business rule component.

To create a SOA application with business rules:

  1. Create a SOA application and project. For more information, see Section 2.1.1, "How to Create a SOA Application and Project". For a SOA composite using business rules, pick the required technologies for your application. For example, you may need the following for a SOA application with business rules: ADF Business Components, Java, and XML. You move these items to the Selected area on the Project Technologies tab.

  2. In the Application Navigator, if the SOA composite editor is not showing, then in your project expand SOA Content folder and double-click composite.xml to launch the SOA composite editor.

  3. From the Component Palette, drag-and-drop a Business Rule from the Service Components area of the SOA menu to the Components lane of the SOA composite editor, as shown in Figure 24-13.

    Figure 24-13 Adding Business Rules to a SOA Composite Application

    Description of Figure 24-13 follows
    Description of "Figure 24-13 Adding Business Rules to a SOA Composite Application"

  4. When you drag-and-drop a Business Rule, Oracle JDeveloper displays the Create Business Rules dialog as shown in Figure 24-14.

    Figure 24-14 Adding Business Rules to a SOA Composite and Creating a Dictionary

    Description of Figure 24-14 follows
    Description of "Figure 24-14 Adding Business Rules to a SOA Composite and Creating a Dictionary"

Add inputs for business rules:

  1. In the Create Business Rules dialog box, from the menu next to the Add icon select Input... to add input for the business rule. This displays the Type Chooser dialog.

  2. In the Type Chooser dialog, add inputs. If the schema is available in the Project Schema Files, skip to step 9 to select the appropriate schema.

  3. Click the Import Schema File... icon. This brings up the Import Schema File dialog.

  4. In the Import Schema File dialog click Browse Resources to choose the XML schema elements for the input. This displays the SOA Resource Browser dialog.

  5. In the SOA Resource Browser dialog, navigate to find the schema for your business rules input. For example, select the order.xsd schema file, and click OK.

  6. In the Import Schema File dialog select Copy to Project, as shown in Figure 24-15.

    Figure 24-15 Importing Schema for Input to Business Rules

    Description of Figure 24-15 follows
    Description of "Figure 24-15 Importing Schema for Input to Business Rules"

  7. In the Import Schema File dialog, click OK.

  8. In the Localize Files dialog, click OK.

  9. Use the Type Chooser dialog navigator to locate and select the input from the schema and click OK. For example, select the CustomerOrder element as the input.

Add outputs for business rules:

  1. In the Create Business Rules dialog, from the dropdown menu next to the Add icon select Output....

  2. In the Type Chooser dialog, in a manner similar to adding an input add the output. For example, add OrderApproval from the order.xsd and click OK.

  3. This displays the Create Business Rules dialog, as shown in Figure 24-16.

    Figure 24-16 Create Business Rules Dialog with Input and Output

    Description of Figure 24-16 follows
    Description of "Figure 24-16 Create Business Rules Dialog with Input and Output"

Set options and create decision service and business rules dictionary:

  1. In the Create Business Rules dialog, select Expose as Composite Service.

  2. If you do not want to use the default service name, then select the Advanced tab and in the Service Name field enter the service name.

  3. In the Create Business Rules dialog, click OK. This creates the Business Rule component, also called a Decision component, and Oracle JDeveloper shows the Business Rule component in the canvas workspace as shown in Figure 24-17.

    Figure 24-17 Business Rule Component in SOA Composite

    Description of Figure 24-17 follows
    Description of "Figure 24-17 Business Rule Component in SOA Composite"

  4. Double-click the Decision component (for example the OracleRules1 business rule). This opens Rules Designer, as shown in Figure 24-18. The validation log shows validation warnings for the input and output facts. By working with Rules Designer to define rules or decision tables, you remove these warning messages.

    Figure 24-18 Rules Designer Showing New Dictionary for SOA Composite Application

    Description of Figure 24-18 follows
    Description of "Figure 24-18 Rules Designer Showing New Dictionary for SOA Composite Application"

For information on Rules Designer, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

24.5.2 How to Select and Modify a Decision Function in a Business Rule Component

You can specify one or more decision functions as inputs for calling Oracle Business Rules as a component in a composite application. For example, you can specify a particular decision function as the input when multiple decision functions are available in an Oracle Business Rules dictionary.

To specify a decision function in a composite application:

  1. Add a decision function to the Oracle Business Rules dictionary. For more information, see Oracle Fusion Middleware User's Guide for Oracle Business Rules.

  2. Add a Business Rule component to the composite application. For more information, see Section 24.5.1, "How to Add Business Rules to a SOA Composite Application".

  3. Select a business rule component, as shown in Figure 24-19.

    Figure 24-19 Selecting a Business Rule Component in a Composite Application

    Description of Figure 24-19 follows
    Description of "Figure 24-19 Selecting a Business Rule Component in a Composite Application"

  4. Select the decision function port of interest. For example, select the port for DF_2 as shown in Figure 24-20.

    Figure 24-20 Selecting a Decision Function Port in a Business Rule Component

    Description of Figure 24-20 follows
    Description of "Figure 24-20 Selecting a Decision Function Port in a Business Rule Component"

  5. When you select the port, Oracle JDeveloper shows the port information in the Property Inspector.

  6. When you double-click the port, Oracle JDeveloper displays the Update Interface dialog for the port as shown in Figure 24-21.

    Figure 24-21 Update Interface Dialog for a Decision Function in a Business Rule Decision Port

    Description of Figure 24-21 follows
    Description of "Figure 24-21 Update Interface Dialog for a Decision Function in a Business Rule Decision Port"

24.6 Running Business Rules in a Composite Application

You run business rules as part of a Decision component within a SOA composite application. The business rules are executed by the Business Rule Service Engine. You can use Oracle Enterprise Manager Fusion Middleware Control to monitor the Business Rule Service Engine and to test a SOA composite application that includes a Decision component. For more information, see Oracle Fusion Middleware Administrator's Guide for Oracle SOA Suite and Oracle BPM Suite.

24.6.1 What You May Need to Know About Testing a Standalone Decision Service Component

To test a standalone Decision Service component by using Oracle Enterprise Manager Fusion Middleware Control, you must provide the name of the Decision Service as the value of the payload name field in the Test Web Service page as shown in Figure 24-22.

Figure 24-22 Invoking a Standalone Test Decision Service

test standalone decision service
Description of "Figure 24-22 Invoking a Standalone Test Decision Service"

'name' in payload should be the Decision Service name as can be seen in the sample .decs file in Figure 24-23.

Figure 24-23 Sample .decs File

sample.decs file
Description of "Figure 24-23 Sample .decs File"

Without the Decision Service name, it would not be possible to invoke the standalone Decision Service with just the payload and endpoint details.

24.7 Using Business Rules with Oracle ADF Business Components Fact Types

You can use Oracle ADF Business Components Fact Types and ActionTypes from the Business Rules Service Engine. Typically, a Decision component can be used within a SOA composite and wired to a BPEL component and the Oracle Business Rules rules act on XML types. The Business Rules Service Engine is called as a web service with a payload containing instances of the XML schema types, and the service engine returns a response similarly.

It is also possible to use Oracle ADF Business Components Fact Types from a Decision component. Instead of loading the Oracle ADF Business Components Fact Type instances and passing them to the Business Rules Service Engine, you call the Business Rules Service Engine with configuration information describing how the Oracle ADF Business Components view object rows can be loaded. Special Oracle Business Rules decision functions in the DecisionPointDictionary and classes in the Oracle Business Rules SDK Decision Point API then load the rows and assert Oracle ADF Business Components fact type instances. When working with Oracle ADF Business Components Fact Types, you write rules that use user-defined Java classes which inherit from ActionType to affect action, such as modifying the Oracle ADF Business Components fact type instances such that they update their underlying database rows.

A Decision component requires an XML document as input. The Oracle Business Rules Decision Point dictionary provides an XML Fact Type called SimpleDecisionPointInput that serves as this input. The primary key(s) of Oracle ADF Business Components are passed to the business rule service component. The business rule service component invokes a user-defined decision function which it invokes to load the Oracle ADF Business Components view object instances, asserts them in the rules engine, and then marshals the results in the following order:

  1. DecisionPointDictionary.DecisionPoint_Preprocessing_Webservice Ruleset: The preprocessing ruleset reads the business component from the database and asserts them as facts.

  2. User-defined rulesets: The user ruleset matches these facts and should assert facts that extend ActionType to update the business component.

  3. DecisionPointDictionary.DecisionPoint_Postprocessing_Webservice Ruleset: The actual updating is performed by the postprocessing ruleset. Use of ActionTypes is optional.

For specific instructions on how to use Oracle ADF Business Components Fact Types and ActionTypes from the Business Rules Service Engine, see the source code for Oracle Business Rules-specific samples and SOA samples available online at

https://soasamples.samplecode.oracle.com