Gopalan Suresh Raj
Web Cornucopia
Gopalan's Profile
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
Click me to subscribe Download Open ESB
Syndication
Search

Table of Contents
Tags
bpel choreography ejb esb http integration javacaps javaee javaone jax-ws jbi management openesb orchestration process-oriented rest sca service-oriented soa soap wsdl xml xsd
Links
 
Referrers

Today's Page Hits: 185

Map of Visitors
Locations of visitors to this page
Caveat Emptor
This is my personal weblog. The contents of this Weblog represent my personal opinion which may differ from the official views of my employer, Sun Microsystems, Inc. or any past employers. I do not speak for my employer or any past employers.
View Gopalan Suresh Raj's profile on LinkedIn
« BEA's Mike Rowley... | Main | The simplicity and... »
Monday Jul 03, 2006
Jul
3
BPEL: What are partnerLinkTypes, roles, and partnerLinks.
BPEL is a Web Service Sequencing Language. A BPEL Process defines a conversation flow chart and a BPEL Process instance is a particular conversation following the chart which consists of only WSDL-described message exchanges. BPEL provides and consumes WSDL-defined services. BPEL execution systems can thus support multiple concurrent conversations.

Links to all the different WSDL-defined web services that a BPEL process instance interacts with are called partner links. They are concrete references to services that a BPEL business process interacts with. Links to WSDL-defined web services that are invoked by a BPEL process are called Invoked partner links. Similarly, links to WSDL-defined web services that can invoke a BPEL process are called Client partner links. Each BPEL process will definitely have at least one Client partner link since a BPEL process can only be instantiated with a call from a Client partner.

A BPEL process can interact with a WSDL-defined web service in three distinct ways:
  1. WSDL-defined web services can invoke a BPEL process
  2. WSDL-defined web services can be invoked by a BPEL process
  3. WSDL-defined web services that have either characteristics or roles, in that, they may be invoked by the BPEL process, and they may in turn invoke the BPEL process.
Scenario 1: WSDL-defined web services can invoke a BPEL process
In this scenario, the BPEL process provides a IRequestLoan portType (interface) through which a WSDL-defined Client Partner web service invokes the requestLoan operation.


From the WSDL-service Client Partner's point of view, it requires a BPEL Process to provide a IRequestLoan portType(interface) with a requestLoan operation that it can invoke. From the BPEL Process's point of view, it offers a IRequestLoan portType(interface) with a requestLoan operation that any other web service could invoke.

Partner Link Type and Role:
Instead of describing business processes based on a certain point of view, BPEL introduces the concept of a role, and the concept of a partner link type. Relationships are modeled based on the role that they play in the business process rather than individual points of view. A partner link type defines how two individual WSDL-defined partners can interact together and what each of the partners have to offer. partner link types are defined in WSDL files through the WSDL extensibility element mechanism.

Scenario 2: WSDL-defined web services can be invoked by a BPEL process
In this scenario, the Invoked partner provides a ILoanProcessor portType (interface) through which a WSDL-defined BPEL Process invokes the processLoanRequest operation.

From the BPEL Process's point of view, it requires a WSDL-defined Invoked Partner to provide a LoanProcessor portType with a processLoanRequest operation that it can invoke. From the Invoked Partner's point of view, it offers a LoanProcessor portType with a processLoanRequest operation that any other web service could invoke.

Scenario 3: WSDL-defined web services that have either characteristics
In this scenario, a WSDL-defined Invoked Partner offers a IAdjuster portType (interface) that has an addNewAdjustmentJob operation. the BPEL process provides a AdjusterCallback portType (interface) that the Invoked Partner can use to callback the BPEL Process's submitAdjustmentJob operation.


From the BPEL Process's point of view, the process requires a WSDL-defined Invoked Partner that implements the IAdjuster portType (interface) with a addNewAdjustmentJob operation and provides an AdjusterCallback portType (interface) with a submitAdjustmentJob operation. From the WSDL-defined Invoked Partner's point of view, it offers an IAdjuster portType (interface) with a addNewAdjustmentJob operation and requires a BPEL Process that provides an AdjusterCallback portType (interface) with a submitAdjustmentJob operation.

The partnerLinkType and role Definitions in WSDL Files
Partner  link  types are defined in WSDL files through the WSDL extensibility element mechanism. The <partnerLinkType> element is embedded directly within the WSDL file of every partner process and service process involved in a BPEL orchestration. <partnerLinkType> elements defined in the partner’s WSDL file identify the WSDL portType (interface) element referenced by the partnerLink in the service process’s BPEL process definition.

The <partnerLinkType> element contains one <role> element for each role (service provider or service consumer) the service process can play, as defined by its partnerLink element—myRole (indicating a service provider) and partnerRole (indicating a service consumer) attributes—in the service process’s BPEL process definition. Therefore, a partnerLinkType can have either one or two <role> child elements. The following example shows one <role> child element.

<definitions name="LoanProcessorEJBWrapper"
            targetNamespace="http://localhost/loanRequestorBpel/LoanProcessorEJBWrapper"
            xmlns:tns="http://localhost/loanRequestorBpel/LoanProcessorEJBWrapper"
            xmlns="http://schemas.xmlsoap.org/wsdl/"
            xmlns:plink="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"
...
>
...
  <plink:partnerLinkType name="loanProcessorEjbPartner">
    <plink:role name="loanProcessorEJB" 
portType="ns:LoanProcessorEJBSEI">
    </plink:role>
  </plink:partnerLinkType>
...
</definitions>

In situations when a service process has the same relationship with multiple partner processes, the service process’s BPEL partnerLink elements can reference the same partnerLinkType.

The partnerLinks and partnerLink Definitions in BPEL files
Partner Links are defined in BPEL files. The <partnerLink> definition defines the portType (interface) of the partner process that will participate in BPEL orchestrations of the business process being defined. These partner processes can act as clients to the service process being defined or can be invoked by the service process. The <partnerLink> element encodes communication exchange information between the service process and its partner processes. The role of the service process will vary according to the nature of communication with its partner process. For the example, when the LoanRequestor service process invokes a LoanProcessorEJB partner process, it may act in a LoanRequestor role and the LoanProcessorEJB partner process may act in a LoanProcessorEJB role.

The <partnerLink> element contains the myRole and partnerRole attributes that establish the roles for the service process and its partner process, respectively, as illustrated in the following code example.

<partnerLinks>
  <partnerLink name="bpelImplemented"
               partnerLinkType="ns0:loanRequestorPartnerLinkType"
               myRole="loanRequestor"/>
  <partnerLink name="ejbInvoked"
               partnerLinkType="ns1:loanProcessorEjbPartner"
               partnerRole="loanProcessorEJB"/>
</partnerLinks>

The myRole attribute is used when the service process acts as the service provider and is being invoked by a service consumer partner process client. Similarly, the partnerRole attribute identifies the service provider partner process that the service process is invoking when acting in a service consumer client role.


Download the Java EE 5 Tools Bundle Beta from http://java.sun.com/javaee/downloads/index.jsp for FREE, and provide us feedback on the improvements you'd like to see. It combines the new Java EE 5 SDK with NetBeans IDE 5.5 Beta, NetBeans Enterprise Pack 5.5 Early Access, and Sun Java System Application Server Platform Edition 9. This bundle also contains Project Open ESB Starter Kit Beta, Java EE 5 samples, Java BluePrints, and API docs (Javadoc).

The screen-shot below shows the WSDL for Scenarios 1 and 2 in the Sun NetBeans 5.5 Enterprise Pack WSDL Editor
The screen-shot below shows the BPEL for Scenarios 1 and 2 in the Sun NetBeans 5.5 Enterprise Pack BPEL Visual Designer
 
 


Posted at 07:01AM Jul 03, 2006 by Suresh Gopalan in BPEL  |  Listen to this article Listen to this entry  |  Comments added Comments[2]
Tags:
Share This Post: del.icio.us | furl | simpy | slashdot | technorati | digg

Comments:

The plink schema http://schemas.xmlsoap.org/ws/2004/03/partner-link/ for the partner link type in the WSDL does not resolve to a valid web resource. Where can I obtain a copy of this schema?

Posted by Karl Uppiano on May 22, 2007 at 10:35 AM PDT #

WS-BPEL 2.0 is an OASIS standard.

You can get the latest schema from here:

<em><strong>http://docs.oasis-open.org/wsbpel/2.0/serviceref</strong></em>

Cheers

Gopalan.&nbsp;

&nbsp;

Posted by Gopalan Suresh Raj on May 22, 2007 at 04:14 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Disclaimer: The contents of this Weblog represent my personal opinion which may differ from the official views of my employer, Sun Microsystems, Inc. or any past employers.



View blog top tags

Enter your email address:

Delivered by FeedBurner

[Valid RSS]