How to Handle Errors in a Peer Process Using Message Events

Communicating With Other BPMN Processes and Services 20-5 To invoke an asynchronous service operation using message events: 1. Edit the BPM process where you want to invoke the asynchronous service operation. 2. Locate the point in your process where you want to invoke the asynchronous service operation. 3. Add a message throw event in the point you located in your process. 4. Right-click the message throw event.

5. Select Properties.

6. Click the Implementation tab.

7. In the Conversation section, select Initiates.

8. In the Properties section, select Service Call from the Implementation list.

You must ensure that the service you select is an asynchronous service.

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

The Type dialog appears. 10. Select the asynchronous service you want to invoke.

11. Click OK.

12. From the Operation list, select the operation to invoke from the asynchronous service. 13. If the asynchronous service requires arguments, configure the message throw event data association. See Section 8.13, Introduction to Data Associations , for more information on how to configure data associations.

14. Click OK.

15. Follow the procedure described in Section 20.3.2, How to Receive the Callback Operation of an Asynchronous Service Using Message Events to invoke the callback operation of the asynchronous process.

20.3.2 How to Receive the Callback Operation of an Asynchronous Service Using Message Events

You can receive the callback operation that pairs with an asynchronous operation using message events. To receive the callback operation of an asynchronous service using message events: 1. Edit the BPM process where you want to receive the callback of the asynchronous service. 2. Locate the point in your process where you want to receive the callback operation of the asynchronous service. 3. Add a message catch event in the point you located in your process. 4. Right-click the message catch event.

5. Select Properties.

6. Click the Implementation tab.

20-6 Modeling and Implementation Guide for Oracle Business Process Management

7. In the Conversation section, select Continues.

The Properties section changes, and the Initiator Node list appears. 8. From the Initiator Node list, select the activity in your process that invokes the asynchronous service. The content of the Properties section changes, and the Name field and the Operation list appear. The Name field shows the asynchronous service that corresponds to the operation the initiator event invokes.

9. Click OK.

The Type dialog disappears and the message catch event properties dialog shows the service you selected in the name field. 10. From the Operation list, select the callback operation to receive. 11. If the asynchronous service requires arguments, configure the message throw event data association. See Section 8.13, Introduction to Data Associations , for more information on how to configure data associations.

12. Click OK.

20.3.3 What Happens When You Invoke an Asynchronous Service Operation Using Message Events

When you invoke an asynchronous service operation using a message throw event, the BPMN Service Engine does not wait for the service to answer. It continues running the flow objects that follow to the message throw event. The BPMN process can obtain the response of the asynchronous service by invoking the service callback operation using a message catch event. Even if the service finishes running, the BPMN process does not receive the service response until it invokes the callback operation using a message catch event. If the service is still running when the BPMN Service Engine runs the message catch event, then the engine waits for the service operation to complete before passing the token to the next flow object in the process.

20.3.4 How to Invoke an Asynchronous BPMN Process Operation Using Message Events

You can invoke a node in an asynchronous BPMN process using message events. To invoke an asynchronous BPMN process operation using message events: 1. Edit the BPM process where you want to invoke the asynchronous BPMN process. 2. Locate the point in your process where you want to invoke the asynchronous BPMN process. 3. Add a message throw event in the point you located in your process. 4. Right-click the message throw event.

5. Select Properties.

6. Click the Implementation tab.

7. In the Conversation section, select Initiates.