Call Asynchronous BPEL process From Another BPEL Process

In this example, I will show you how to call an asynchronous BPEL process from another BPEL process. Here I will call asynchronous BPEL process created in previous example. Copy the URL of WSDL of the previously created BPEL service and we will use it in this example for invoking that service. Follow the below steps to implement this.

  1. Create a SOA project same like previous article and select Composite With BPEL Process option in the next wizard.Asynchronous_Partner_link_1
  2. Click on FINISH button and BPEL process creation wizard will open. Enter BPEL process name and select Asynchronous BPEL Process as template typeAsynchronous_Partner_link_2
  3. Click on OK button and BPEL process will open like below screenshotAsynchronous_Partner_link_3
  4. Select PARTNER LINK from Web Service Component and drag and drop it into the right swim laneAsynchronous_Partner_link_4
  5. Enter Partner link name and paste the URL of WSDL that was copied from the previous exampleAsynchronous_Partner_link_5
  6. Select INVOKE activity from component palate and drag and drop it after receiveInputAsynchronous_Partner_link_6
  7. Drag a wire from Invoke activity to Partner link and editor wizard of invoke activity will open. Create an input variable of invoke activity by clicking on green plus icon.Asynchronous_Partner_link_7
  8. Select RECEIVE activity from Web Service Component and drag and drop it after the invoke activityAsynchronous_Partner_link_8
  9. Double click on Receive activity to open the editor wizard of receive activity. Enter receive activity name and create a variable. Select AsyncPartnerLink as Partner Link and select Create Instance checkboxAsynchronous_Partner_link_9
  10. Now BPEL process will look like below screenshotAsynchronous_Partner_link_10
  11. Drag and drop an ASSIGN activity before invoke activity and do the mapping between input payload and input variable of invoke activityAsynchronous_Partner_link_11
  12. Drag and drop one moreA�ASSIGN activity after receive activity and do the mapping between input variable of receive activity and output variableAsynchronous_Partner_link_12
  13. Save the whole project and deploy the project in Integrated Web logic Server
  14. Test the project in EM console and check the flow by clicking on Launch Flow TraceAsynchronous_Partner_link_13
  15. Check the flow of both BPEL Services. Click on AsyncBPELProcess and you will see that the process is waiting for the completion of wait activity.Asynchronous_Partner_link_14
  16. Click on AsyncBPEL process. As the calling BPEL process is not completed, the receive activity is still pending to receive the outcome of the calling service.Asynchronous_Partner_link_15

Check the instance flow after 30 seconds again. All the process will be completed as expected.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here