9.3. Microsoft XLANG: BPEL ForerunnerMicrosoft published XLANG[*] in 2001 as the business process language for its BizTalk ecommerce suite. Compared with the offerings of more recent BPM standards, XLANG is a relatively simple language, but its ideas, along with those of WSFL, form the basis for the design of BPEL. As an author and supporter of BPEL, Microsoft has turned away from XLANG and effectively shelved it. (BPM time moves rapidly!) Nonetheless, understanding XLANG is valuable for two reasons:
The pi-calculus connection is examined in Chapter 3. This chapter focuses on the first point. XLANG is an early XML-based, web services-aware process definition language. An XLANG process is defined in a WSDL as part of the definition of a WSDL service. The XLANG process defines the behavior of the service. NOTE Basic WSDL knowledge is essential to understanding XLANG. In previous chapters we have seen that a WSDL port type is a set of operations with message input and output types. A WSDL port binds a port type to a specific transport endpoint. A service is a set of ports. Calling a web service means connecting to one of its ports and interfacing with one of the port's operations by exchanging messages with it. In the code sample in Example 9-2, the service AcctService (lines 31-49), which has ports AcctPort (lines 32-34) and AcctCallbackPort (lines 35-37) corresponding to port types AcctPT (lines 8-12) and AcctCallbackPT (lines 12-21) respectively, is augmented with an XLANG behavior (lines 39-48) that consists of three action activities. The first activity (lines 42-43) launches the XLANG process when the operation UpdateAcct is invoked on the AcctPort port of the enclosing service. The second and third activities (line 44-45) invoke the operations ACK and UpdateResponse, respectively, on port AcctCallbackPort. The activities are executed in order. The process is stateful: the first activity, whose activation attribute is set to true, launches the process, and the second and third continue it; because there are no further activities, the process stops after completion of the third activity. Example 9-2. Update account WSDL and XLANG process1 <?xml version="1.0"?> 2 <definitions name="UpdateAccount" 3 targetNamespace="http://mike.com/xlang/acct" 4 xmlns:tns=" http://mike.com/xlang/acct" 5 xmlns:xlang="http://schemas.microsoft.com/biztalk/xlang/ 6 xmlns="http://schemas.xmlsoap.org/wsdl/"> 7 8 <portType name="AcctPT"> 9 <operation name="UpdateAcct"> 10 <input message="..."/> 11 </operation> 12 </portType> 13 14 <portType name="AcctCallbackPT"> 15 <operation name="ACK"> 16 <output message="..."/> 17 </operation> 18 <operation name="UpdateResponse"> 19 <output message="..."/> 20 </operation> 21 </portType> 22 23 <binding name="AcctBinding" type="tns:AcctPT"> 24 <!-- details omitted --> 25 </binding> 26 27 <binding name="AcctCallbackBinding" type="tns:AcctCallbackPT"> 28 <!-- details omitted --> 29 </binding> 30 31 <service name="AcctService"> 32 <port name="AcctPort" binding="tns:AcctBinding"> 33 <soap:address location="http://a.com/ws/acct.jws"/> 34 </port> 35 <port name="AcctCallbackPort" binding="tns:AcctCallbackBinding"> 36 <soap:address location="http://x.com/ws/acct.jws"/> 37 </port> 38 39 <xlang:behavior> 40 <xlang:body> 41 <xlang:sequence> 42 <xlang:action operation="UpdateAcct" port="AcctPort" 43 activation="true"/> 44 <xlang:action operation="ACK" port="AcctCallbackPort"/> 45 <xlang:action operation="UpdateResponse" port="AcctCallbackPort"/> 46 </xlang:sequence> 47 </xlang:body> 48 </xlang:behavior> 49 </service> 50 </definitions> The use of the action activity to invoke or receive a web service operation is reminiscent of BPML, as are XLANG 's control flow activities (sequence, switch, all, and while) compensation and exception handling, context scoping, and message correlation. XLANG's influence on BPEL is considerable (as will be discussed further later), but so is its influence on BPML. XLANG, like WSCI and other choreography languages, also provides for the definition of a global view of service interactions. Referred to as the business process contract the global view is a like a sequence diagram, capturing participants and their exchange of messages. In Example 9-3, the two participants have services AcctService and AcctUserService, representing the provider and caller, respectively, of account update. The contract in lines 16-26 requires that AcctPort in service AcctService interfaces with port AcctRequestPort in service AcctUserService (the connect in lines 19-21) and that AcctCallbackPort in AcctService connects with AcctResponse port in AcctUserService (lines 22-24). The direction of message exchange is not captured in the contract; direction is given in the WSDL definitions imported in lines 11-14. Example 9-3. Update account XLANG business process contract1 <?xml version="1.0"?> 2 <definitions name="AcctContract" 3 targetNamespace="http://mike.com/xlang/acct/contract" 4 xmlns:tns=" http://mike.com/xlang/acct/contract" 5 xmlns:xlang="http://schemas.microsoft.com/biztalk/xlang/" 6 xmlns:acct="http://mike.com/xlang/acct" 7 xmlns:user="http://mike.com/xlang/user " 8 xmlns="http://schemas.xmlsoap.org/wsdl/"> 9 10 <!-- import the acct and user namespaces --> 11 <import namespace="http://mike.com/xlang/acct" 12 location=http://mike.com/xlang/acct.wsdl/ 13 <import namespace="http://mike.com/xlang/user" 14 location="http://mike.com/xlang/user.wsdl"/> 15 16 <xlang:contract> 17 <xlang:services refs="acct:AcctService user:AcctUserService"/> 18 <xlang:portMap> 19 <xlang:connect 20 port="acct:AcctService/AcctPort" 21 port="user:AcctUserService/AcctRequestPort"/> 22 <xlang:connect 23 port="acct:AcctService/AcctCallbackPort " 24 port="user:AcctUserService/AcctResponsePort"/> 25 </xlang:portMap> 26 </xlang:contract> 27 </definitions> |