Dynamic Partner Link in BPEL

Problem: Accessing external service from the BPEL process where the address of the external services will be updated when the external service have different version or deployed on to different location with only changes in binding section.

External Service Development: Develop a bpel process which takes string as input and return the string output as “version : processversion input Data : input string” E.g. “version :2.0 input : Manohar”

Implementation: Create a SOA project with name as “VersionProject” and Synchronous bpel process with name “VersionProcess”

Next

Finish

Click OK

Double Click on the “VersionProcess”

Add the “Assign” activity to the process and assign the “OutputVariable” with

concat(“Version: “,ora:getProcessVersion(), ” input Data: “, $inputVariable.payload/client:input)

Click Ok

Deploy the project with 3 different versions

Version 1.0 WSDL URL:

http://localhost:7001/soa-infra/services/default/VersionProject!1.0*soa_7a3502df-e26f-4f0b-a009-ffa2c08fbb04/versionprocess_client_ep?WSDL

Version 2.0 WSDL URL:

http://localhost:7001/soa-infra/services/default/VersionProject!2.0*soa_b7df1d0d-582e-4402-bbc7-be68666d7d50/versionprocess_client_ep?WSDL

Version 3.0 WSDL URL:

http://localhost:7001/soa-infra/services/default/VersionProject/versionprocess_client_ep?WSDL

Dynamic Partner Link: Client accessing partner link dynamically


Create a Client SOA project with name “DynamicPartnerLink” and BPEL process with “DynamicClient”

Update the xsd as below

Open the BPEL component and add a external partner link for VersionProject3.0

Click OK

Create a SOA-MDS connection as below

Once the Connection is made to DEV_MDS we should be able access the shared WS-Addressing.xsd

In BPEL editor create a element variable for

Click on browse button

Click OK à OK àSelect “EndpointReference” and click Ok

Know your variables window looks as below

Add an “Assign” activity to BPEL Process.

Click on “Assign_URL_to_addressVar” and assign URL to addressVar as below

Add “Invoke” activity to BPEL Process and connect the invoke activity to Partner Link i.e. VersionProjectPL

Add two more “Assign” activities before Invoke activity.

One Assign activity ” Assign_addressVar_PartnerLink” for assigning addressVar to PartnerLink

Another assign for copying input msg to Invoke activity input variable

Add one more “Assign” activity after the Invoke activity to assign invokeoutput variable to output variable

Finally BPEL process looks as below. Deploy the project on to Weblogic server

Testing the DynamicPartnerLink Project through SOAPUI tool

To create a SOAPUI project we need to have WSDL url. For our project the wsdl is

http://localhost:7001/soa-infra/services/default/DynamicPartnerLink/dynamicclient_client_ep?WSDL

Go to File à New SOAPUI Project à Enter the details and click ok

You can find the project created with sample request for the operation exposed in service.

Click on “Request1”

Enter the inputs for the request to test VersionProject1.0 and click “Play button”

Msg: Manohar

URL: http://localhost:7001/soa-infra/services/default/VersionProject!1.0*soa_7a3502df-e26f-4f0b-a009-ffa2c08fbb04/versionprocess_client_ep?WSDL

Repeat the test with URL for VersionProject2.0

Msg: Manohar

URL: http://localhost:7001/soa-infra/services/default/VersionProject!2.0*soa_b7df1d0d-582e-4402-bbc7-be68666d7d50/versionprocess_client_ep?WSDL

Repeat the test with URL for VersionProject3.0

Msg: Manohar

URL: http://localhost:7001/soa-infra/services/default/VersionProject/versionprocess_client_ep?WSDL

30 responses

  1. Is there anyway you can post/send your xsd/project?

    1. Hi Tejas,

      Check ur mail.. i have mailed the project source code.

      1. Manohar,

        Good Post!!!

        Can you please share me the project to pavan.20aug@gmail.com

        Regards,
        Pavan

      2. Hi Manohar,

        Thanks, Very very useful.

        Could you please share the source code to asadallakhan@outlook.com

  2. Its Perfect.. #Would recommend my dear friends to leave a thanks just before the code request. Should appreciate the effort in posting free blogs.. Nice Post…..

  3. Very nice
    Keep posting

  4. Simple and Very nice Thank You 🙂

  5. The best I found so far! Thank you!

  6. excellent post..thanku!

  7. Very Useful. Thanks

  8. Excellent post so far…. Thank you

  9. Excellent post Manohar garu . could you plz send the source code to my mail id: nannuri.bk@gmail.com

  10. Hi Manohar,

    Nice post!!!Worked like a charm!!

    However,More than Dynamic Partner Link I found it to be a URL Passthrough/URL Override.What I pass it goes.

    Is there anything possible where I can choose between Static URLs as per as the requirement?

    I mean I have URL A , URL B and URL C.
    If input 1 comes I like to dispatch to URL A
    If input 2 comes I like to dispatch to URL B
    If input 3 comes I like to dispatch to URL C.

    I know this can be achieved through Mediator.
    But what If I like to do it in BPEL?

    Rgds,
    Deb

    1. Hi Deb,

      Use either DVM or XRef to store the static URL so that you can add or update the existing urls if required.
      Use the lookup function to retrieve the url to which the request has to dispatched based on the input and then use WS-Addressing to element to update the partnerlink before making invoke call.

      Regards,
      Manohar

      1. Thanks a lot Manohar!!
        I will explore the cross reference part.
        Uncharted territory 🙂

        Rgds,
        Deb

  11. Hi Manohar,

    We are following the same process in SOA 12c where we are mapping the end point reference to Partner link. Following is the error message we are getting.

    From value is not a sref:service-ref element.

    Please suggest us to get rid of the issue. Thanks in advance.

  12. Excellent post. Thanks.

    Deb,
    You can achieve using control flow statements like “if” in BPEL.

  13. Thanks for the wonderful post Manohar. I have a requirement where I have to pass parameter to ULR from BPEL Workflow. CASE NUMBER is a global var
    ex: http://XXX/details/

    Appreciate you help

  14. Hi Manohar, Wonder Post Thanks a lot.
    Can we build Partnerlink using parameter
    here is what my requirement is

    Partner link is like http://XXXX/details/
    where TicketNumber is a global var and set by BPEL workflow

    Any input/suggestion.. please
    Regards,
    Pavan

  15. Promit Mukherjee | Reply

    Hi,

    For the dynamic partner Link “DynamicPartnerLink” BPEL Process, I am using BPEL 2.0 in JDeveloper 11.1.1.7.

    But it is giving error in the second assign:

    $addressVar

    Error is: fromValue is not a sref:service-ref element.

    Can you please suggest any workaround?

    Regards,
    Promit

  16. superb……..sir

  17. Nice Post.Can you email a copy of the sourcecode?

  18. Excellent Post..executed in 12c. BPEL 2.0 would not support for “Dynamic Partner Link”. Need to use BPEL 1.1.

  19. Excellent post, Manohar! Thanks. I am getting a soap fault message as “Error is: fromValue is not a sref:service-ref element.”. Need your help please. Thanks in advance.

    1. Can you mail your project

  20. Hi, Thanks for the detailed procedure. Do you still have the source code/files for the application the article develops? If so, could you please share it with me at jay.jaganathan1@gmail.com? Thanks.

  21. Manohar,
    Great blog. I have the same requirement and I was using your approach. At runtime I am getting an error on the second Assign(Assigning “addressVar” to partner link). Any help is appreciated. Thanks!

    1. Share me your code to check or whatsapp me

      1. Manohar, Attached the project for your reference. Kindly help.

        TkeLaInoFd01SendItems_bpel1.zip

Leave a comment