Introduction to BPEL Processes in Oracle BPM

Using Business Rules 16-1 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: ■ Section 16.1, Introduction to Business Rules in Oracle BPM ■ Section 16.2, Assigning an Existing Business Rule to a Business Rule Task ■ Section 16.3, Creating a Business Rule from Oracle BPM Studio For detailed information about Oracle Business Rules, see Oracle Fusion Middleware Users 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: ■ Using Oracle BPM ■ From the SOA New Gallery ■ From the SOA Composite editor 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 Users Guide for Oracle Business Rules. Figure 16–1 shows a business rule component in the Sales Quote example. 16-2 Modeling and Implementation Guide for Oracle Business Process Management Figure 16–1 Business Rules Components in the Business Catalog This figure shows the Rules predefined module in the business catalog. The Rules predefine module contains a module Salesquoteprocess that in turn contains a business rule component named ApprovalRules.

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.