To support synchronous request - response service operation, if a Web service has an output or a response message, service invocation framework uses the callback mechanism in Oracle Workflow to communicate the response message back to Oracle E-Business Suite through the Business Event System.
Note: A synchronous request - response message is a common message exchange pattern in Web service operation where a client asks a service provider a question and then waits for a response before continuing on. For more information about this operation pattern, see Understand Message Patterns.
This callback feature takes the invoker event's event key to enqueue the callback event to the specified inbound agent (the callback agent) for the response. In addition, if a workflow process invokes a Web service using a "Raise" event activity and waits for Web service response using a "Receive" event activity, the invoker event key should be the same as the invoker and/or waiting workflow process's item key so that when callback is performed, the waiting workflow process is correctly identified by WF_ENGINE.EVENT API.
By using both the callback event and agent, Web service invocation can be integrated back with a waiting workflow process or any other module within Oracle E-Business Suite. Web service invocation uses the following callback subscription or event parameters:
WFBES_CALLBACK_EVENT
This parameter can have a valid business event to be raised upon completion of the Web service with the service output message as the payload.
For example, it can be like:
WFBES_CALLBACK_EVENT=oracle.apps.wf.myservice.callback
WFBES_CALLBACK_AGENT
This parameter can have a valid business event system agent to which the event with the service response message as the payload can be enqueued.
Attention: This parameter will work only if WFBES_CALLBACK_EVENT is not null; otherwise, the output message is lost and there is no callback.
For instance, it can be like the default inbound agent (or any other inbound queue) for Web service messages:
WFBES_CALLBACK_AGENT=WF_WS_JMS_IN
Note: If you have defined custom agents, you can also specify the custom agent names as the parameter values.
Since Web service output message is enqueued to the inbound agent mentioned in WFBES_CALLBACK_AGENT, it is required to set up a Workflow Agent Listener on the inbound agent (if it is not yet set up) in order to process the callback/receive business event messages.
Note: Callback event can be used as correlation ID when the response message is enqueued to a callback agent. This helps administrators to create a specialized agent listener on the callback agent to process the callback event.
For example, if the callback event for a service invocation is oracle.apps.wf.myservice.callback, and the callback agent is WF_WS_JMS_IN, when this event is enqueued to WF_WS_JMS_IN upon a successful service invocation, the event oracle.apps.wf.myservice.callback is used as Correlation ID in WF_WS_JMS_IN to help create an agent listener to process that event.
At run time, if event parameters are passed with the same names as the subscription parameters that have been parsed and stored, the event parameter values take precedence over subscription parameters. For instance, the event parameters are passed as follows:
BusinessEvent.setStringProperty("WFBES_CALLBACK_EVENT", "oracle.apps.wf.myservice.callback");
BusinessEvent.setStringProperty("WFBES_CALLBACK_AGENT", "WF_WS_JMS_IN");
To use the callback feature during the service invocation, you must create a receive event and subscribe to the receive event. See: Creating a Receive Event and Event Subscription (Optional).
The better understand how to invoke a Web service, see An Example of Invoking a Web Service from a Workflow Process