Modeling and Implementation Guide for Oracle Business Process Management
View PDF

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

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

When you double-click a business rule component in the business catalog, 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 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 map the following:

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

Generally after a business rule task you 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.

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

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

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


16.2 Assigning an Existing Business Rule to a Business Rule Task

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

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

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

  5. Select a Business Rule from the list or type the name or part of the name in the Search field to search for a Business Rule.

  6. Click OK.

    The Type dialog 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 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 Business Rule Engine using the input arguments defined in the business rule task data association. The Business Rule Engine evaluates the rules using the provided input argument and returns an output argument that contains the result of this evaluation.

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.

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 the SOA Suite.

16.3.1 How to Create a Business Rule from Oracle BPM Studio

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 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 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 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 a business object based on an external type as their type.

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

  3. Select a data object from the Data Object dialog 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

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.