To asynchronously invoke the WarehousingConfirmationBPEL
service, we will do the following:
BookWarehousingBPEL.wsdl
interface.callbackClient
), we will add a new scope, called WarehousingConfirmationInvocation
.<invoke>
activity to invoke the WarehousingConfirmationBPEL
service invocation. Next, we will name the activity WarehousingConfirmationInvoke
.<invoke>
activity to the WarehousingConfirmationBPEL partner link.WarehousingConfirmationBPEL
), and Operation (confirmWarehousing
), as shown in the following screenshot:WarehousingConfirmation_inputVariable
:<assign>
activity. Place it before the <invoke>
activity. In the <assign>
activity, we will prepare the WarehousingConfirmation_inputVariable
variable for the asynchronous invoke. Name the <assign>
activity AssignWarehousingConfirmation
.WarehousingConfirmation_inputVariable
variable, we need to make assignments. Double-click on the <assign>
activity and copy the data. Copy the BookISSN
, Title
, Edition
, and PublishingYear
from the BookData
variable to the WarehousingConfirmation_inputVariable
variable. Copy the Bookstore
location from the BookstoreLocationWithLowestStockQuantity
variable, as shown in the following screenshot:We have added the asynchronous invocation of the WarehousingConfirmationBPEL
service with the corresponding assign. The following BPEL code has been generated:
To wait for the callback, we could use the <receive>
activity. However, with the <receive>
activity, we could only wait for a single operation callback. In our case, we have three possible operation callbacks.
Therefore, we will use the <pick>
activity. With the <pick>
activity, we can specify that the BPEL process awaits the occurrence of one of a set of events. Events can be message events handled using the <onMessage>
activity and alarm events handled using the <onAlarm>
activity. For each event, we then specify an activity or a set of activities that should be performed.
Within <pick>
, we can specify several <onMessage>
and <onAlarm>
elements. The <onAlarm>
elements are optional (we can specify zero or more), but we have to specify at least one <onMessage>
element.