Skip Headers
Oracle® Fusion Middleware Modeling and Implementation Guide for Oracle Business Process Management
11g Release 1 (11.1.1.6.3)

Part Number E15176-11
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

16 Using Business Rules

This chapter describes how to implement business rule tasks in Oracle BPM. You can use an existing business rule component created using the SOA Business Rule editor, or you can create a new business rule component using the simplified interface Oracle BPM Studio provides.

This chapter includes the following sections:

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

16.1 Introduction to Business Rules in Oracle BPM

The business rule task requires you to define a business rule to implement it. You can use an existing business rule or define a new one.

If your project contains business rules, then they automatically appear in the business catalog.

You can add new business rules to the business catalog in the following ways:

The business catalog displays the business rules in your project in the predefined module Rules. It stores each rule in a module named as the package of the business rule dictionary.

When you double-click a business rule component in the business catalog, Oracle BPM Studio opens the SOA Business Rules editor. You can edit the business rule using this editor.

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

Figure 16-1 shows a business rule component in the Sales Quote example.

Figure 16-1 Business Rules Components in the Business Catalog

Description of Figure 16-1 follows
Description of "Figure 16-1 Business Rules Components in the Business Catalog"

16.1.1 Using Business Rules in a BPMN Process

Business rules enable you to determine the flow of your processes based on a group of rules you define.

The business rule task enables you to associate the following:

  • Data object values to the input arguments of a business rule

  • The output arguments of a business rule component to data objects

When a token arrives at a business rule task, the BPMN Service Engine invokes Oracle Business Rules Engine using the input arguments defined in the data association of the business rule task. The business rules engine evaluates the defined rules and returns output that contains the result. The BPMN Service Engine maps the output from the business rules engine to the data objects in the process using the data association defined for the business rule task.

After a business rule task, you can add an exclusive gateway that determines the flow of the process based on the value of a data object that contains the result of running the business rule task.

In the Sales Quote example, the business rule task determines the approval flow for each sales quote in the following way:

  • The business rule task invokes the business rule component providing a Quote business object as an input argument.

  • The business rule component evaluates the defined rules using the provided input.

  • The business rule component returns an ApprovalFlow business object that contains the result of evaluating the defined rules.

  • The business rule task data association maps the result of running the business rule to the approvalFlow process data object.

  • The exclusive gateway Is Business Practices Review Required determines the flow based on the value of the approvalFlow process data object.

Figure 16-2 shows a business rule task in the Sales Quote example.

Figure 16-2 Business Rule Task in the Sales Quote Example

Description of Figure 16-2 follows
Description of "Figure 16-2 Business Rule Task in the Sales Quote Example"

16.2 Assigning an Existing Business Rule to a Business Rule Task

You can assign existing business rules to a business rule task. You can implement a business rule task using a business rule that you created using the Business Rule wizard or that existed in the SOA project you used as the basis for the BPM project.

All the business rule components that your project contains appear in the Rules predefined module in the business catalog. They also appear in the SOA composite. If there are business rule tasks in your BPMN processes that use a business rule component, then the SOA composite shows a wire between them.

16.2.1 How to Assign an Existing Business Rule to a Business Rule Task

You can reuse existing business rules to implement the business rules tasks in your BPMN processes.

To assign an existing business rule to a business rule task:

  1. Right-click the business rule task.

  2. Select Properties.

  3. Click the Implementation tab.

  4. Click the Browse button next to the Business Rule field.

    The Type dialog box appears.

  5. Select a business rule from the list or enter the name or part of the name in the Search field to search for a business rule.

  6. Click OK.

    The Type dialog box closes, and the Business Rule field shows the business rule you selected.

  7. From the Decision Function list, select a decision function.

  8. Click OK.

    The Business Rule Task Properties dialog box closes and saves the implementation you selected for the business rule task.

16.2.2 What Happens When You Assign an Existing Business Rule to a Business Rule Task

The business rule task implementation uses the selected business rule component and the selected decision function.

When the BPMN Service Engine runs the business rule task, it invokes the Oracle Business Rules Engine using the input arguments defined in the business rule task data association. The Oracle Business Rules Engine evaluates the rules using the provided input argument and returns an output argument that contains the result of this evaluation.

16.2.3 How to Edit the Business Rule Associated to a Business Rule Task

You can launch the Business Rule Editor from a business rule task, to edit the associated business rule.

To edit the business rule associated to a business rule task:

  1. Right-click the business rule task.

  2. Select Open Business Rule.

    The Business Rule Editor appears.

16.3 Creating a Business Rule from Oracle BPM Studio

You can create a business rule using the simplified interface Oracle BPM Studio provides. You can access this interface from the business rule task configuration dialog box.

The simplified business rule creation interface enables you to create a business rule with one decision function. When you create the business rule, you can configure the following properties:

After you create the business rule with the simplified interface you can edit it using the editor included in Oracle SOA Suite.

16.3.1 How to Create a Business Rule from Oracle BPM Studio

You can create a business rule component from Oracle BPM Studio from the Implementation Properties dialog box of a business rule task.

To create a business rule from Oracle BPM Studio:

  1. Right-click the Business Rule task.

  2. Select Properties.

  3. Click the Implementation tab.

  4. Click the Add button next to the Business Rule field.

    The Create Business Rule dialog box appears.

  5. In the Name field, enter a name to identify the business rule.

  6. Configure the input and output of the business rule.

    See Section 16.3.2, "How to Add Input and Output Arguments When Creating a Business Rule Component" for more information on how to configure the input and output of a business rule.

  7. Optionally, configure the advanced properties of the business rule.

    See Section 16.3.3, "How to Configure the Advanced Properties When Creating a Business Rule Component" for more information on how to configure the advanced properties of a business rule.

  8. Click OK.

    The Create Business Rule closes and creates the business rule. The Business Rule field in the Business Rules Task Properties dialog box shows the business rule you created.

  9. From the Decision Function list, select a decision function.

  10. Click OK.

    The Business Rule Task Properties dialog box, closes and saves the implementation you created for the business rule task.

16.3.2 How to Add Input and Output Arguments When Creating a Business Rule Component

The data objects you add as input or output arguments must use business objects based on external types as their types.

To add input and output arguments when creating a business rule component:

  1. In the Input and Output Data Objects section, click the Add button.

  2. Select the type of argument you want to add.

    The Data Object dialog box appears.

  3. Select a data object from the Data Object dialog box and drag it to the table.

    The input or output argument appears in the table.

16.3.3 How to Configure the Advanced Properties When Creating a Business Rule Component

To configure the advanced properties when creating a business rule component:

  1. Click the Advanced tab.

  2. In the Package field, enter the name of the package in which to store the rules dictionary.

  3. In the Decision Function field, enter a name for the decision function that the simplified interface creates in the business rule component.

16.3.4 What Happens When You Create a Business Rule Task from Oracle BPM

Oracle BPM Studio creates a business rule component. You can edit this business rule component using the SOA Business Rule editor in the same way you edit a component created using Oracle SOA Suite.

The business rule task uses the business rule component for its implementation.