How to Create a Business Exception

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

20.3 Using Message Events to Invoke Asynchronous Services and Asynchronous BPMN Processes

You can use message events to invoke asynchronous services and asynchronous BPMN processes. To invoke an asynchronous operation from service or BPMN process you must use an intermediate throw message event configured to initiate a conversation. When the BPMN Service Engine runs the message throw event, it creates an XML message based on: ■ the asynchronous operation ■ the input required by the asynchronous operation ■ the data association defined for the message throw event Then it sends the XML message to the service or BPMN process, and continues running the rest of the process flow. It does not wait for the asynchronous service or BPM process to answer. The asynchronous service or BPMN process receives the message and runs the requested operation. When it finishes it sends a message with the result of the operation to the BPMN process that invoked it. This message is the callback operation of the asynchronous service or BPMN process. The BPMN process that invoked the asynchronous operation must wait for the callback operation to obtain its results. The BPMN process must define a message catch event that waits for the callback operation. This message catch event continues the conversation and uses the message throw event that invoked the operation as the initiator event. When a token arrives to the message catch event it might receive an immediate answer if the asynchronous process completed, or might have to wait until the asynchronous process completes to get an answer. Figure 20–1 Invoking an Asynchronous Service or BPMN Process Using Message Events This figure shows a BPMN process that invokes an asynchronous operation defined in an external service or in another BPMN process. This BPMN process uses message events to invoke the asynchronous operation.

20.3.1 How to Invoke Asynchronous Service Operation Using Message Events

You can invoke an asynchronous service operation using message events.