A receive event can serve as a communication vehicle to communicate or callback to Oracle E-Business Suite if a Web service has an output or response message required to be communicated back after the Web service has been successfully invoked. However, whether you need to create a receive event and an external subscription to the receive event depends on the following criteria:
Your message pattern
Where your event is raised from (Java or PL/SQL layer)
Event subscription phase number
For Synchronous Request-Response Web Service Invocation
If the Web service invoker event is raised from Java code in the middle tier, and the invoker subscription is synchronous with subscription phase < 100, then the Web service is invoked as soon as the event is raised. If the invocation is successful, the response can be read by the calling application and is available immediately by using BusinessEvent.getResponseData() method after calling BusinessEvent.raise().
In this case, the response may not have to be communicated back to Oracle E-Business Suite using a callback event. Hence, you may not need to create a receive event and the subscription to the event.
If the Web service invoker event is raised from Java code with the subscription phase is >= 100, or if the event is raised from PL/SQL, the event message will be enqueued to WF_JAVA_DEFERRED queue. In this situation, you will need to create a receive event and an external subscription to the event if the Web service has an output or a response message. A callback event with callback agent is required to receive the output message into Oracle E-Business Suite.
This receive event can also be used as a callback into Oracle E-Business Suite to let the interested parties know through raising this event that the Web service response is available.
See: Calling Back to Oracle E-Business Suite With Web Service Response.
If a receive event is required, after creating the receive event, you must create an external event subscription to the receive event. The Web service response message communicated through the receive event is always enqueued to an inbound workflow agent. In order to process an event from the inbound workflow agent, an external subscription is required.
For Request-only Web Service
If it is a request-only Web service which does not require a response, you do not need to create a receive event.
To create a receive event:
In the Events page, click Create Event to open another Create Event page.
Enter the following information in the Create Event page:
Name: Enter an event name, such as oracle.apps.xxx.user.webservice.receive
Display Name: Enter an event display name, such as oracle.apps.xxx.user.webservice.receive
Description: Enter a description for the event
Status: Enabled
Owner Name: Enter an application or program name that owns the event (such as 'Oracle Workflow')
Owner Tag: Enter the application or program ID that owns the event (such as 'FND')
Click Apply to create a receive event.
To create a receive event subscription:
Log in to Oracle E-Business Suite as a user who has the Workflow Administrator Web Applications responsibility. Select the Business Events link, and choose Subscriptions in the horizontal navigation.
In the Event Subscriptions page, click Create Subscription to open the Create Event Subscription page.
Enter the following information in the Create Event Subscription page:
Subscriber: Select the local system
Source Type: External
Event Filter: Select the receive event name that you just created, such as oracle.apps.xxx.user.webservice.receive
Phase: any phase number
Status: Enabled
Rule Data: Key
Action Type: any action type
On Error: Stop and Rollback
Click Next to open the Create Event Subscription - Launch Workflow page.
Please note that the type of the Create Event Subscription page to be shown depends on the value selected in the Action Type field. If "Launch Workflow" is selected, you will see the Create Event Subscription - Launch Workflow page. If other action types are selected, different types of the create event subscription pages are displayed. By entering an appropriate action type through the subscription page, you can launch a workflow process or execute a custom rule function for the event defined as part of this subscription.
Enter the following information in the Action region:
Workflow Type: Enter a workflow type that is waiting for the response
Workflow Process: Enter a workflow process that is waiting for the response
Priority: Normal
In the Documentation region, enter an application or a program name in the Owner Name field (such as 'Oracle Workflow'). Enter an application or a program ID in the Owner Tag field (such as 'FND').
Click Apply.