Time for action – invoking the WarehousingConfirmation service

To asynchronously invoke the WarehousingConfirmationBPEL service, we will do the following:

  1. Open the BookWarehousingBPEL.wsdl interface.
  2. Scroll to the bottom of the process. After the human task and before the callback (callbackClient), we will add a new scope, called WarehousingConfirmationInvocation.
  3. Within the scope, first add an <invoke> activity to invoke the WarehousingConfirmationBPEL service invocation. Next, we will name the activity WarehousingConfirmationInvoke.
  4. Connect the <invoke> activity to the WarehousingConfirmationBPEL partner link.
  5. A window pops up, where we will specify the Partner Link, Port Type (WarehousingConfirmationBPEL), and Operation (confirmWarehousing), as shown in the following screenshot:
    Time for action – invoking the WarehousingConfirmation service
  6. We do not have the input variable created yet; therefore, we will create this on the fly, using the green plus sign icon.
  7. Pressing the green plus sign icon opens the Create Variable window. We will create a variable, local to the scope, and name it WarehousingConfirmation_inputVariable:
    Time for action – invoking the WarehousingConfirmation service
  8. Next, we will add the <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.
  9. To prepare the 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:
    Time for action – invoking the WarehousingConfirmation service
  10. After clicking on the OK button, we should see the following BPEL excerpt:
    Time for action – invoking the WarehousingConfirmation service

What just happened?

We have added the asynchronous invocation of the WarehousingConfirmationBPEL service with the corresponding assign. The following BPEL code has been generated:

What just happened?

Waiting for callback

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.189.99