How to Configure the End Event of a Synchronous Process

Defining the Process Interface 21-15

21.7 Defining Asynchronous Processes Operations Using Send and Receive Tasks

You can define asynchronous operations in a BPMN Process using send and receive tasks. If you expose an asynchronous operation, then you must expose a start operation. The process invoking the asynchronous service must invoke the start operation first to create an instance in the process. The asynchronous operation runs over the created instance. You must also specify a callback operation for each of the asynchronous operations you define.

21.7.1 How to Define an Asynchronous Process Operation Using Send and Receive Tasks

You can define an asynchronous process operation using send and receive tasks. To define an asynchronous process operation using send and receive tasks: 1. Edit the BPMN process. 2. Change the trigger of the start and end events to None: a. Right-click the event.

b. Select Properties.

c. Click the Implementation tab.

d. From the Implementation Type list, select None.

e. Click OK.

3. Add a receive task immediately after the start event. 4. Right-click the receive task.

5. Select Properties.

6. Click the Implementation tab.

7. Select Create Instance.

8. In the Conversation section, select Initiates.

9. In the Conversation Properties section, select Define Interface.

10. If your asynchronous BPMN process requires input data, then you must define the process input in the Argument Definition section. For more information on how to define the process output, see Section 21.10, Defining the Process Input and Output .

11. Expand the Advanced section.

12. Select Asynchronous.

13. Enter a name for the start operation. The SOA Composite uses the name you specify for the operation to display it in the SOA Composite.

14. Click OK.

21-16 Modeling and Implementation Guide for Oracle Business Process Management 15. Follow the procedure described in Section 21.7.3, How to Define a Callback Process Operation Using a Send Task , to define the callback operation of the asynchronous BPMN process.

21.7.2 How to Add an Asynchronous Process Operation to the Process Interface Using a Receive Task

You can expose a receive task as an asynchronous process operation. To add an asynchronous process operation using a receive task: 1. Edit the BPMN process. 2. Locate the point in your process where you want to add the new operation. 3. Add a receive task in the point you located. 4. Right-click the receive task.

5. Select Properties.

6. Click the Implementation tab.

7. In the Conversation section, select Initiates.

8. In the Conversation Properties section, select Define Interface.

9. If your asynchronous BPMN process requires input data, then you must define the process input in the Argument Definition section. For more information on how to define the process output, see Section 21.10, Defining the Process Input and Output .

10. Expand the Advanced section.

11. Select Asynchronous.

12. Enter a name for the start operation. The SOA Composite uses the name you specify for the operation to display it in the SOA Composite.

13. Click OK.

21.7.3 How to Define a Callback Process Operation Using a Send Task

You can expose a send task as the callback operation that pairs with an asynchronous process operation. How to define the callback operation for an asynchronous process using a send task: 1. Edit the BPMN process. 2. Locate the point in your process where you want to return the answer of the corresponding operation. 3. Add a send task to the point you located in your process. You must place the send task after the receive task in the process flow. 4. Right-click the send task.

5. Select Properties.

6. Click the Implementation tab.

Defining the Process Interface 21-17

7. In the Conversation section, select Continues.

8. From the Initiator list, select the receive task to associate with the callback. 9. If you want your asynchronous process to return output data, then you must define the process output in the Argument Definition section. For more information on how to define the process output, see Section 21.10, Defining the Process Input and Output .

10. Expand the Advanced section.

11. Select Synchronous or Asynchronous.

12. To change the name of the start operation, then enter a name. The SOA Composite uses the name you specify for the operation to display it in the SOA Composite.

13. Click OK.

21.7.4 What Happens When You Define an Asynchronous Operation Using Send and Receive Tasks

The asynchronous operation and the corresponding callback operation are available for other processes to invoke them. When you invoke the process asynchronous operation you defined, you must not wait for a response before continuing with the process flow. To obtain the response you must invoke the process callback operation. The SOA Composite shows the asynchronous operation and its callback in the BPMN process interface. You can invoke asynchronous BPMN processes using message events or send and receive tasks. See Section 20.3, Using Message Events to Invoke Asynchronous Services and Asynchronous BPMN Processes and Section 20.7, Using Send and Receive Tasks to Invoke Asynchronous Services and Asynchronous BPMN Processes , for more information on how to invoke an asynchronous BPMN process.

21.8 Using Send and Receive Tasks to Define a Synchronous Operation in a BPMN Process

You can define a synchronous operation in your BPMN process using send and receive tasks. You define the synchronous operation using a receive task and send tasks that continues the receive task. The receive task defines the process input and the send task defines the process output. If you use a send task to define a synchronous operation, then you must also define a start operation. You must invoke the start operation before invoking the synchronous operation, to create an instance in the process. The synchronous operation runs over the created instance. See Chapter 20.5, Using Service Tasks to Invoke Synchronous Operations in Services and BPMN Processes , for information on how to invoke a synchronous operation in a BPMN process from another BPMN process. 21-18 Modeling and Implementation Guide for Oracle Business Process Management

21.8.1 How to Configure a Process Operation as Synchronous Using Send and Receive Tasks

You can expose send and receive tasks as a synchronous process operation. To configure a process operation as synchronous: 1. Edit the BPMN process. 2. Change the trigger of the start and end events to None: a. Right-click the event.

b. Select Properties.

c. Click the Implementation tab.

d. From the Implementation Type list, select None.

e. Click OK.

3. Add a receive task after the start event. 4. Right-click the receive task.

5. Select Properties.

6. Click the Implementation tab.

7. Select Create Instance.

8. In the Conversation Properties section, select Define Interface.

9. If your synchronous BPMN process requires input data, then you must define the process input in the Argument Definition section. For more information on how to define the process input, see Section 21.10, Defining the Process Input and Output .

10. Expand the Advanced section.

11. Select Synchronous.

12. Enter a name for the start operation. The SOA Composite uses the name you specify for the operation to display it in the SOA Composite.

13. Click OK.

21.8.2 What Happens When You Define a Synchronous Operation Using Send and Receive Tasks

The asynchronous operation and the corresponding callback operation are available for other processes to invoke them. You must invoke synchronous operations in a BPMN processes using a service tasks. See Section 20.5, Using Service Tasks to Invoke Synchronous Operations in Services and BPMN Processes , for more information on how to invoke a synchronous BPMN process. In the SOA Composite, the interface of a synchronous process only shows one operation for the receive task. Defining the Process Interface 21-19 21.9 Using Send and Receive Tasks with an Interface from the Business Catalog to Define Your Process Interface When configuring the receive tasks that define the interface of your process, you can choose to use an existing interface instead of defining an interface. You can choose any of the operations from the components in the business catalog and use it as the interface for your process operations. The operation from the component in the business catalog that you choose to define the interface of your operation, determines if your operation is synchronous or asynchronous. If you define a receive task using an interface from the business catalog, then the associated send task must also use an interface from the business catalog. If the operation you are defining is asynchronous, then the message send task can only use callback operations. Figure 21–6 shows a process that uses a BPEL process from the business catalog to define its operations. It also shows how the SOA Composite editor indicates that a BPMN process uses another SOA Component to define its interface. Figure 21–6 BPMN Process that uses an interface from the Business Catalog defined using send and receive tasks This figure shows a BPMN process defined using send and receive task that uses an interface from the business catalog. It also show this reflects in the SOA Composite editor.