How to Define a Callback Operation Using Message Events

21-12 Modeling and Implementation Guide for Oracle Business Process Management 12. If the interface you selected requires input data, then you must specify how the data objects in the project map to this input data, by configuring the message event data association. For more information on how to configure data associations, see Section 8.13, Introduction to Data Associations .

13. Click OK.

14. Configure an existing message end or message throw event to use an interface from the business catalog or add a new event and configure it, following the procedure described in Section 21.5.2, How to Configure a Message End or a Message Throw Event to Use an Interface from the Business Catalog Using Message Events . 21.5.2 How to Configure a Message End or a Message Throw Event to Use an Interface from the Business Catalog Using Message Events You can use an interface from the business catalog to define the interface of your BPMN process. To configure a message end or message throw event to use an interface from the business catalog: 1. Edit the BPMN process. 2. Right-click the message end or message throw event.

3. Select Properties.

4. Click the Implementation tab.

5. In the Conversation section, select Continues.

The Properties section changes, the Initiator Node, Name and Operation fields appear. 6. From the Initiator Node list, select the message start or message catch event that defines the process interface.

7. Click the Browse button next to the Name field.

The Type dialog appears. 8. Select the component you want to use as the message catch or message end interface.

9. Click OK.

10. From the Operation list, select the operation you want to use as the as the message catch or message end interface. 11. If the interface you selected requires output data, then you must specify how the data objects in the project map to this output data, by configuring the message event data association. See Section 8.13, Introduction to Data Associations , for more information on how to configure data associations. 12. Click OK. Defining the Process Interface 21-13

21.5.3 What Happens When You Use an Interface from the Business Catalog to Define an Operation

The operation you define uses the signature of the operation form the interface in the business catalog. To invoke the operation in the BPMN process you must use the same operation name and input that you use to invoke the operation in the interface from the business catalog. The operation in the BPMN process returns the same output that the operation in the interface from the business catalog. The SOA composite shows a wire between the BPMN process and the interface used to define its operations. If you define all the process operations using interfaces from the business catalog, then JDeveloper asks you if it should delete the BPMN process WSDL. Because the BPMN process does not define an interface, but uses existing interfaces, its WSDL is no longer necessary and you can delete it.

21.6 Defining the BPMN Process Interface Using Send and Receive Tasks

The process interface contains the operations that other services and processes can invoke to run a BPMN process. These operations may be synchronous or asynchronous. You can define the process interface using message events or send and receive tasks. See Section 21.2, Using Message Events to Define the BPMN Process Interface , for more information on how to define the process interface using message events. To expose an operation in a BPMN process you can use a receive task. The receive task enables you to define if the operation is synchronous or asynchronous. It also enables you to define the process input. The process interface must always contain an operation that exposes a receive task that creates an instance. A process or service that invokes this BPMN process must always invoke this operation before invoking any of the operations in the process. To define the process output, you must configure the send task that continues the receive that defines the operation. If the operation is asynchronous, then the send task also defines the callback operation. If an interface contains an asynchronous operation, then it must also define the callback operation that returns the result of this operation. See Section 21.6.1, Defining the Callback Interface for BPMN Processes Using a Send Task for more information on how to define a callback operation in a BPMN Process. In addition, the process interface may contain the operations exposed by the receive tasks in the process. Before invoking an operation that corresponds to a receive task, you must always invoke the operation that corresponds to the received task configured to create an instance. Figure 21–5 shows a BPMN process that exposes a receive task in its interface in addition to the receive tasks that creates the instance. It also shows how the SOA Composite editor displays these operations. 21-14 Modeling and Implementation Guide for Oracle Business Process Management Figure 21–5 BPMN process that exposes an asynchronous operation defined using send and a receive task This figure shows a BPMN process that exposes an asynchronous operation defined using send and receive tasks, and how this reflects in the SOA Composite editor. If you used a send task to expose an operation, then you must use a receive task to define the callback operation. See Section 21.6.1, Defining the Callback Interface for BPMN Processes Using a Send Task for more information on how to define a callback operation using send events.

21.6.1 Defining the Callback Interface for BPMN Processes Using a Send Task

A BPMN process must expose a callback operation for each of the asynchronous operations it defines. You can define a callback operation using a send task. The callback operation returns the response to the service or process that invoked the asynchronous operation. If the service or process is waiting for the answer, then they receive it immediately. If the service or process is not waiting for the answer yet, then they receive it when they get to the part of the process or code that waits for the answer. The callback operation may define output arguments. If it defines output arguments you must map their values to the data objects in the process using data associations. Figure 21–5 shows a receive task that exposes the BPMN process callback operation.