Web Services Choreography Description Language Version 1.0 (original) (raw)

1 Introduction

For many years, organizations have been developing solutions for automating their peer-to-peer collaborations, within or across their trusted domain, in an effort to improve productivity and reduce operating costs.

The past few years have seen the Extensible Markup Language (XML) and the Web Services framework developing as the de facto choices for describing interoperable data and platform neutral business interfaces, enabling more open business transactions to be developed.

Web Services are a key component of the emerging, loosely coupled, Web-based computing architecture. A Web Service is an autonomous, standards-based component whose public interfaces are defined and described using XML. Other systems may interact with a Web Service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols.

The Web Services specifications offer a communication bridge between the heterogeneous computational environments used to develop and host applications. The future of E-Business applications requires the ability to perform long-lived, peer-to-peer collaborations between the participating services, within or across the trusted domains of an organization.

The Web Service architecture stack targeted for integrating interacting applications consists of the following components:

The Web Services Choreography specification is aimed at the composition of interoperable collaborations between any type of participant regardless of the supporting platform or programming model used by the implementation of the hosting environment. A choreography description is the multi-participant contract that describes this composition from a global perspective. The Web Services Choreography Description Language (WS-CDL) is the means by which this technical contract is described.

1.1 Notational Conventions

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC-2119 [RFC2119].

The following namespace prefixes are used throughout this document:

Prefixes and Namespaces used in this specification

Prefix Namespace URI Definition
wsdl http://www.w3.org/2005/08/wsdl WSDL 2.0 namespace for WSDL framework.
cdl http://www.w3.org/2005/10/cdl WSCDL namespace for Choreography Description Language.
xsi http://www.w3.org/2001/XMLSchema-instance Instance namespace as defined by XSD [XMLSchemaP1].
xsd http://www.w3.org/2001/XMLSchema Schema namespace as defined by XSD [XMLSchemaP2].
tns (various) The "this namespace" (tns) prefix is used as a convention to refer to the current document.
rns (various) A namespace prefix used to refer to an (example and fictitious) WSDL interface specification.
(other) (various) All other namespace prefixes are examples only. In particular, URIs starting with "http://www.example.com" represent some application-dependent or context-dependent URIs [RFC2396].

This specification uses an informal syntax to describe the XML grammar of a WS-CDL document:

An XSD is provided as a formal definition of WS-CDL grammar (see Section 11).

Where there is any discrepancy between the text of this specification, the fragments of informal schema and the full formal schema in the appendix then it is an error in the specification. Should such an error come to light please notify W3C. While awaiting resolution, the text takes priority over the formal schema in the appendix, which takes priority over the informal schema fragments.

1.2 Purpose of WS-CDL

Business or other activities that involve different organizations or independent processes are engaged in a collaborative fashion to achieve a common business goal, such as Order Fulfillment.

For the collaboration to work successfully, the rules of engagement between all the interacting participants must be provided. Whereas today these rules are frequently written in English, a standardized way for precisely defining these interactions, leaving unambiguous documentation of the participants and responsibilities of each, is missing.

The WS-CDL specification is aimed at being able to precisely describe collaborations between any type of participant regardless of the supporting platform or programming model used by the implementation of the hosting environment.

Using the WS-CDL specification, a contract containing a "global" definition of the common ordering conditions and constraints under which messages are exchanged, is produced that describes, from a global viewpoint, the common and complementary observable behavior of all the participants involved. Each participant can then use the global definition to build and test solutions that conform to it. The global specification is in turn realized by combination of the resulting local systems, on the basis of appropriate infrastructure support.

The advantage of a contract based on a global viewpoint as opposed to any one endpoint is that it separates the overall "global" process being followed by an individual business or system within a "domain of control" (an endpoint) from the definition of the sequences in which each business or system exchanges information with others. This means that, as long as the "observable" sequences do not change, the rules and logic followed within a domain of control (endpoint) can change at will and interoperability is therefore guaranteed.

In real-world scenarios, corporate entities are often unwilling to delegate control of their business processes to their integration partners. Choreography offers a means by which the rules of participation within a collaboration can be clearly defined and agreed to, jointly. Each entity may then implement its portion of the choreography as determined by the common or global view. It is the intent of WS-CDL that the conformance of each implementation to the common view expressed therein is easy to determine.

The figure below demonstrates a possible usage of WS-CDL.

Integrating Web Services based applications using WS-CDL

In Figure 1, Company A and Company B wish to integrate their Web Services based applications. The respective business analysts at both companies agree upon the services involved in the collaboration, their interactions, and their common ordering and constraint rules under which the interactions occur. They then generate a WS-CDL based representation. In this example, a choreography specifies the interactions between services across business entities ensuring interoperability, while leaving actual implementation decisions in the hands of each individual company:

Similarly, a choreography can specify the interoperability and interactions between services within one business entity.

1.3 Goals

The primary goal of the WS-CDL specification is to specify a declarative, XML based language that defines from a global viewpoint the common and complementary observable behavior specifically, the information exchanges that occur and the jointly agreed ordering rules that need to be satisfied.

More specifically, the goals of the WS-CDL specification are to permit:

1.4 Relationship with XML and WSDL

The WS-CDL specification depends on the following specifications: XML 1.0 [XML], XML-Namespaces [XMLNS], XML-Schema 1.0 [XMLSchemaP1], [XMLSchemaP2] and XPath 1.0 [XPTRF]. Support for including and referencing service definitions given in WSDL 2.0 [WSDL20] is a normative part of the WS-CDL specification. In addition, support for including and referencing service definitions given in WSDL 1.1 as constrained by WS-I Basic Profile [BP11] is a normative part of the WS-CDL specification.

1.5 Relationship with Business Process Languages

WS-CDL is not an "executable business process description language" or an implementation language. The role of specifying the execution logic of an application will be covered by these [XLANG], [WSFL], [WSBPEL], [BPML], [XPDL], [JLS], [C#S] and other specifications.

WS-CDL does not depend on a specific business process implementation language. Thus, it can be used to specify truly interoperable, collaborations between any type of participant regardless of the supporting platform or programming model used by the implementation of the hosting environment. WS-CDL may couple with other languages such as those that add further computable semantic definitions.

Each participant, adhering to a WS-CDL collaboration representation, could be implemented using completely different mechanisms such as:

1.6 Time Assumptions

Clock synchronization is unspecified in the WS-CDL technical specification and is considered design-specific. In specific environments between involved participants, it can be assumed that all participants are reasonably well synchronized on second time boundaries. However, finer grained time synchronization within or across participants, or additional support or control are undefined and outside the scope of the WS-CDL specification.

1.7 Authoritative Schema

In the event of any ambiguity or differentiation between the WS-CDL fragments and the appendix with the full schema, the full schema takes precedence.

2 WS-CDL Model Overview

WS-CDL describes interoperable, peer-to-peer collaborations between participants. In order to facilitate these collaborations, services commit to mutual responsibilities by establishing formal relationships. Their collaboration takes place in a jointly agreed set of ordering and constraint rules, whereby information is exchanged between the participants.

The WS-CDL model consists of the following entities:

3 WS-CDL Document Structure

A WS-CDL document is simply a set of definitions. Each definition is a named construct that can be referenced. There is a package element at the root, and the individual choreography type definitions inside.

3.1 Choreography Package

A choreography package aggregates a set of WS-CDL type definitions, provides a namespace for the definitions and through the use of XInclude [XInclude], MAY syntactically include WS-CDL type definitions that are defined in other choreography packages.

The syntax of the package construct is:

<package
name="NCName" author="xsd:string"? version="xsd:string"? targetNamespace="uri" xmlns="" title="undefined" rel="noopener noreferrer">http://www.w3.org/2005/10/cdl">

* * * * * * *

Choreography-Notation*

The choreography package contains the following WS-CDL type definitions:

The top-level attributes name, author, and version define authoring properties of the choreography document.

The targetNamespace attribute provides the namespace associated with all WS-CDL type definitions contained in this choreography package. WS-CDL type definitions included in this package, using the inclusion mechanism, MAY be associated with other namespaces.

The elements informationType, token, tokenLocator, roleType, relationshipType, participantType and channelType MAY be used as elements by all the choreographies defined within this choreography package.

3.2 Including WS-CDL Type Definitions

WS-CDL type definitions or fragments of WS-CDL type definitions can be syntactically reused in any WS-CDL type definition by using XInclude [XInclude]. The assembly of large WS-CDL type definitions from multiple smaller, well-formed WS-CDL type definitions or WS-CDL type definitions fragments is enabled using this mechanism.

Inclusion of fragments of other WS-CDL type definitions should be done carefully in order to avoid duplicate definitions (variables, blocks, etc.). A WS-CDL processor MUST ensure that the document is a conforming WS-CDL document [Conforming Document]. It MAY verify that the document conforms to the provided schema [WS-CDL Schema].

The example below shows some possible syntactic reuses of WS-CDL type definitions.

... ...

3.3 WS-CDL document Naming and Linking

WS-CDL documents MUST be assigned a name attribute of type NCNAME that serves as a lightweight form of documentation.

The targetNamespace attribute of type URI MUST be specified.

The URI MUST NOT be a relative URI.

A reference to a definition MUST be made using a "QName".

Each WS-CDL type definition has its own name scope.

Names within a name scope MUST be unique within the WS-CDL document.

The resolution of a "QName" in WS-CDL is similar to the resolution of a "QName" as described by the XML Schemas specification [XMLSchemaP1].

3.4 Language Extensibility

To support extending the WS-CDL language, this specification allows the use of extensibility elements and/or attributes defined in other XML namespaces inside any WS-CDL language element.

Extensibility elements and/or attributes MUST use an XML namespace different from that of WS-CDL.

All extension namespaces used in a WS-CDL document MUST be declared.

Extensions MUST NOT contradict the semantics of any element or attribute from the WS-CDL namespace.

3.5 Semantics

Within a WS-CDL document, descriptions may reference semantic definitions and other documentation. The OPTIONAL description sub-element is allowed inside any WS-CDL language element. Descriptions MAY be text or document references defined in multiple different human readable languages. Where machine processable, WS-CDL parsers are not required to parse the contents of the description sub-element.

The information provided by the description sub-element will reference the descriptions in any or all of the following areas:

The semantics of any element or attribute from the WS-CDL namespace SHOULD remain unchanged and MUST NOT be contradicted.

4 Collaborating Participants

The WSDL specification [WSDL20] describes the functionality of a service provided by a participant based on a stateless, client-server model. The emerging Web Based applications require the ability to exchange information in a peer-to-peer environment. In these types of environments a participant represents a requester of services provided by another participant and is at the same time a provider of services requested from other participants, thus creating mutual multi-participant service dependencies.

A WS-CDL document describes how a participant is capable of engaging in collaborations with the same participant or with different participants.

The roleTypes, _relationshipTypes, participantTypes, and channelTypes define collaborating participants and their coupling.

The typeRef complex type definitions used in participantTypes, relationshipTypes, and channelTypes are different for each. They are type definitions for different local elements even though they have the same tag name. The text in the following sections describes the different attributes and child elements of each.

4.1 RoleType

A roleType enumerates potential observable behavior a participant can exhibit in order to interact. For example, the "Buyer" roleType is associated with the purchasing of goods or services and the "Supplier" roleType is associated with providing those goods or services for a fee.

The syntax of the roleType construct is:

+

The attribute name is used to specify a distinct name for each roleType element declared within a choreography package.

Within the roleType element, a behavior element specifies a subset of the observable behavior a participant exhibits. A roleType MUST contain one or more behavior elements. The attribute name within the behavior element is used to specify a distinct name for each behavior element declared within a roleType element.

The behavior element defines an OPTIONAL interface attribute, which identifies a WSDL interface type. A behavior without an interface describes a roleType that is not required to support a specific Web Service interface.

4.2 RelationshipType

A relationshipType identifies the roleTypes and behaviors, where mutual commitments MUST be made for collaborations to be successful. For example, the relationshipTypes between a "Buyer" and a "Seller" could include:

Although relationshipTypes are always between two roleTypes, choreographies involving more than two roleTypes are possible. For example, if the purchase of goods involved a third-party "Shipper" contracted by the "Supplier" to deliver the "Supplier's" goods, then, in addition to the "Purchasing" and "Customer Management" relationshipTypes described above, the following relationshipTypes might exist:

The syntax of the relationshipType construct is:

The attribute name is used to specify a distinct name for each relationshipType element declared within a choreography package.

A relationshipType element MUST have exactly two roleTypes defined. Each roleType is specified by the typeRef attribute within the roleType element. The "QName" value of the typeRef attribute of the roleType element MUST reference the name of a roleType.

Within each roleType element, the OPTIONAL attribute behavior identifies the commitment of a participant as an XML-Schema list of behavior types belonging to this roleType. If the behavior attribute is missing then all the behaviors belonging to this roleType are identified as the commitment of a participant. If the behavior attribute is present then the behaviors listed MUST be a proper subset of those belonging to this roleType.

4.3 ParticipantType

A participantType groups together those parts of the observable behavior that MUST be implemented by a participant . A logical entity or organization MAY be represented by more than one participantType within a choreography.

The syntax of the participantType construct is:

+

The attribute name is used to specify a distinct name for each participantType element declared within a choreography package.

Within the participantType element, one or more roleType elements identify the roleTypes that MUST be implemented by this participantType. Each roleType is specified by the typeRef attribute of the roleType element. The "QName" value of the typeRef attribute of the roleType element MUST reference the name of a roleType. A specific roleType MUST NOT be specified in more than one participantType element.

An example is shown below where the "SellerForBuyer" roleType belonging to a "Buyer-Seller" relationshipType is implemented by the participantType "Broker" which also implements the "SellerForShipper" roleType belonging to a "Seller-Shipper" relationshipType.

. . . . . .

4.4 ChannelType

A channelType realizes a point of collaboration between participantTypes by specifying where and how information is exchanged. Additionally, channelType instance information, captured within channel variables, can be passed among participants in information exchanges. The channelType instances exchanged MAY be used in subsequent interaction activities. This allows the modeling of both static and dynamic message destinations when collaborating within a choreography. For example, a "Buyer" could specify channelType instance information to be used for sending delivery information. The "Buyer" could then send this channelType instance information to the "Seller" who then forwards it to the "Shipper". The "Shipper" could then send delivery information directly to the "Buyer" using the channelType instance information originally supplied by the "Buyer".

A channelType MUST describe the roleType and the type of a participant reference, conveying the information needed to address the participant being the target of an information exchange, either a receiver of a request action or a sender of a reply action, which is used for determining where and how to send or receive information to or from the participant.

A channelType MAY describe the type of the instance identity of one or more logical conversations between participants, where each conversation groups a set of related information exchanges. The channelType instance identity can be used to correlate multiple conversations (channel instances) within the same choreography instance.

One or more channelType instances MAY be passed around from one participant to another in an information exchange. A channelType MAY be used to:

The syntax of the channelType construct is:

<channelType name="NCName" usage="once"|"distinct"|"shared"? action="request-respond"|"request"|"respond"? >

<passing channel="QName" action="request-respond"|"request"|"respond"? new="true"|"false"? />*

<roleType typeRef="QName" behavior="NCName"? />

<identity usage="primary"|"alternate"|"derived"|"association"> + *

The attribute name is used to specify a distinct name for each channelType element declared within a choreography package.

The OPTIONAL attribute usage is used to constrain the way in which an instance of this channelType, can be used. The values that can be used for this attribute are:

  1. "once" - Once means that a channel instance of this channelType can be used for one interaction, or can be passed to another roleType. When a channel instance of this channelType is passed, the passer of the channel instance MUST relinquish control, for outputting only, of that instance and passes control to the receiver. A channel instance of this channelType MUST NOT be passed to more than one receiver at any one time.
  2. "distinct" (default usage mode) - Distinct means that a channel instance of this channelType can be used multiple times by a participantType within multiple interactions. When a channel instance of this channelType is passed, the passer of the channel instance MUST relinquish control, for outputting only, of that instance and passes control to the receiver. A channel instance of this channelType MUST NOT be passed by a participantType to more than one receiver. In this mode, a participantType MUST NOT specify two or more concurrent interactions for the same channel instance with the same operation name.
  3. "shared" - Shared means that a channel instance of this channelType can be used multiple times by multiple participantTypes within multiple interactions. When a channel instance of this channelType is passed, the participantType passing the channel instance MUST NOT relinquish control. In this mode, a participantType MUST NOT specify two or more concurrent interactions for the same channel instance with the same operation name.

The OPTIONAL attribute action is used to restrict the type of information exchange that can be performed when using a channel instance of this channelType. The type of information exchange performed could either be a request-respond exchange, a request exchange, or a respond exchange. The default value for this attribute is "request".

The OPTIONAL element passing describes the channelTypes of the channel instances that are passed from one participant to another when using an information exchange on a channel instance of this channelType. The OPTIONAL attribute action within the passing element, defines when a channel instance MUST be passed, either during a request exchange, during a response exchange or both. The default value for this attribute is "request". The OPTIONAL attribute new within the passing element, when set to "true", enforces a passed channel instance to be always unique. If the element passing is missing, then this channelType MAY be used for exchanging information, but MUST NOT be used for passing channel instances of any channelType.

The element roleType is used to identify the roleType of a participant, being the type of the target of an information exchange, which is then used for statically determining where and how to send or receive information to or from the participant. Each roleType is specified by the typeRef attribute of the roleType element. The "QName" value of the typeRef attribute of the roleType element MUST reference the name of a roleType defined in the choreography package. Within the roleType element, the OPTIONAL attribute behavior identifies a specific observable behavior, belonging to the roleType that is the target of an information exchange. If the behavior attribute is missing, then any one of the behavior types belonging to this roleType MAY be the target of an information exchange.

The element reference is used to specify the type of a participant reference, conveying the information needed to address the participant being the target of an information exchange, which is used for dynamically determining where and how to send or receive information to or from the participant. The type of a participant reference is distinguished by a token, as specified by the name attribute of the token element within the reference element.

The OPTIONAL list of identity elements MAY be used to associate a unique identity for each instance of the channelType. The identity is defined by a set of tokens specified by the name attribute of the token element within the identity element. If two identity elements are specified within the same or different channelType elements, and they have the same set of named tokens in the same order, then they are considered to represent the same identity type.

The identity element has a mandatory usage attribute, which defines the purpose of the identity in the context of the channelType. The values for this attribute are:

  1. "primary" - The 'primary' usage classification means that the identity is created by the initial message on an instance of this channelType. A channelType must have only one 'primary' identity field.
    An example for using this attribute is shown below. … This means that all messages (requests and responses) exchanged on this "OrderChannel" must contain the 'OrderId' field.
  2. "alternate" - The 'alternate' usage classification means that an alternative identity for a channelType instance can be established. The alternate identity can be initialized based on any message within the channel instance's conversation (i.e. it does not have to be the first). If it is not the first message, then the message must also contain either the channel instance's primary key, or another previously initialized alternate identity, to bind the identity to the channel instance. Once the alternate identity has been bound to the channel instance, subsequent messages that only contain that alternate identity will be correlated to the channel instance.
    An example for using this attribute is shown below. … In this example, an "OrderChannel" channel instance will be identified initially by the value of the 'OrderId' field. However, at some point in the conversation, a message will be exchanged containing the 'TxnId' field. Once this message has occurred, subsequent messages on this channel instance can be correlated based on either the primary 'OrderId' field, or the alternate 'TxnId' field.
  3. "derived" - The 'derived' usage classification means that the identity will be derived from a message sent on the current channel instance (conversation), but it does not directly determine the identity of that current channel instance. Subsequently another channel instance (of the same or different channelType) will reference this identity value in its 'primary' identity field, and that will cause the referencing channel instance to become correlated with the current channel instance in the same choreography instance.
    An example for using this attribute is shown below. … … In this example, the 'OrderId' identifies the "OrderChannel" channel instance, and at some point during its conversation it will exchange a message that contains the 'DeliveryId' information. Although this identity is not relevant from the perspective of the "OrderChannel", it can subsequently be used to determine the identity of the "DeliveryChannel" channel instance, and consequently bind the "DeliveryChannel" instance to the same choreography instance as the original "OrderChannel" channel instance.
  4. "association" - The 'association' usage classification means that this channel instance is correlated to a previous channel instance identity, and therefore is associated with the same choreography instance as the previous channel instance. An identity with this classification is not used to determine the identity of the current channel instance, only to establish the association with a previous channel instance within the same choreography instance. The identity can either relate to another identity definition (in another channelType) that has a usage classification of 'primary'/'alternate', or that has the 'derived' classification. The initial message in the channel instance MUST contain the information to resolve this identity field.
    An example for using this attribute is shown below. … … This example shows how a choreography can contain a single "OrderChannel" channel instance, and zero or more "SupplierChannel" channel instances correlated with it based on an 'association' to the identity established for the "OrderChannel" channel instance.

5 Information Driven Collaborations

Participants make progress within a collaboration when recordings of exchanged information are made, and changes to observable information occur, that then cause ordering constraints to be fulfilled. A WS-CDL document allows defining information within a choreography that can influence the observable behavior of the collaborating participants.

Variables capture information about objects in the choreography, such as the information exchanged or the observable information of the roleTypes involved. Tokens are aliases that can be used to reference parts of a variable. Both variables and tokens have informationTypes that define the type of information the variable contains or the token references.

5.1 InformationType

InformationTypes describe the type of information used within a choreography. By introducing this abstraction, a choreography definition avoids directly referencing the data types, as defined within a WSDL document or an XML Schema document.

The syntax of the informationType construct is:

<informationType name="NCName" type="QName"?|element="QName"? />

The attribute name is used to specify a distinct name for each informationType element declared within a choreography package.

The OPTIONAL attributes type and element describe the type of information used within a choreography as a WSDL 1.1 Message Type, an XML Schema type, a WSDL 2.0 Schema element or an XML Schema element. The attributes type and element MUST be mutually exclusive.

The examples below show some possible usages of the informationType construct.

Example 1: The informationType "purchaseOrder" refers to the WSDL 1.1 Message type "pns:purchaseOrderMessage"

Example 2: The informationType "customerAddress" refers to the WSDL 2.0 Schema element "cns:CustomerAddress"

Example 3: The informationType "intType" refers to the XML Schema type "xsd:int"

5.2 Variables

Variables capture information about objects in a choreography as defined by their usage:

The value of a variable:

If an uninitialized variable is used in any action, except for a blocking workunit or if used in the WS-CDL function isVariableAvailable, then the result of the action is undefined.

The variableDefinitions construct is used for defining one or more variables within a choreography.

The syntax of the variableDefinitions construct is:

+

A variable defined using the attribute informationType specifies either information exchange capturing variables or state capturing variables. A variable defined using the attribute channelType specifies channel capturing variables. The attributes informationType and channelType MUST be mutually exclusive.

The OPTIONAL attribute mutable, when set to "false", specifies that the variable information MUST NOT change once initialized. The default value for this attribute is "true".

The OPTIONAL attribute silent, when set to "true" specifies that there SHOULD NOT be any activity used for creating or changing this variable in the choreography. A silent variable is used to represent the result of actions within a participant that are either not observable or are of no interest from the WS-CDL perspective. The default value for this attribute is "false".

The OPTIONAL attribute free, when set to "true" specifies that a variable defined in an enclosing choreography is also used in this choreography, thus sharing the variable's information. The following rules apply in this case:

The OPTIONAL attribute free, when set to "false" specifies that the variable is defined in this choreography. The default value for the free attribute is "false".

The OPTIONAL attribute roleTypes is used to specify an XML-Schema list of one or more roleTypes of a participant at which the variable information will reside. A variable defined without a roleType is equivalent to a variable that is defined at all the roleTypes that are part of the relationshipTypes of the choreography where the variable is defined. For example, if choreography "choreo1" has relationshipType "rel" that has roleTypes "roleType1" and "roleType2", then a variable "var" defined in choreography "choreo1" without a roleTypes attribute means it is defined at both "roleType1" and "roleType2".

The attribute name is used to specify a distinct name for each variable declared within the variableDefinitions element. In those cases where the visibility of a variable is wholly within a single roleType, then that roleType needs to be named in the definition of the variable as the roleType using the attribute roleTypes. In those cases where the variable is shared amongst a subset of roleTypes within a choreography, those roleTypes need to be listed within the definition of the variable as the roleTypes using the attribute roleTypes.

5.3 Expressions

Expressions can be used within WS-CDL to create new information, and to obtain or change existing information.

Generic expressions and literals can be used to populate variables. Predicate expressions can be used within WS-CDL to specify conditions. Query expressions are used within WS-CDL to specify queries.

The language used in WS-CDL for specifying expressions and queries or conditional predicates MUST be XPath 1.0.

WS-CDL defines a set of XPath 1.0 extension functions that implementers MUST support. The functions are defined in the standard WS-CDL namespace http://www.w3.org/2005/10/cdl. The prefix "cdl:" is associated with this namespace.

5.3.1 WS-CDL Supplied Functions

There are several functions that the WS-CDL specification supplies as XPath 1.0 extension functions. These functions can be used in any XPath 1.0 expression as long as the types are compatible:

5.4 Token and TokenLocator

A token is an alias for a piece of data in a variable or message that needs to be used by a choreography. Tokens differ from variables in that variables contain values which MAY be populated as the result of actions or events within a choreography life-line whereas tokens contain information that define the piece of the data that is relevant.

All tokens MUST have an informationType, for example, an "Order Id" could be of type 'alphanumeric' and a "Counter" could be of type 'integer'.

Tokens reference a document fragment within a choreography definition. Token locators provide a query mechanism to select tokens. By introducing these abstractions, a choreography definition avoids depending on specific message types as described by WSDL, or a specific query string as specified by XPath 1.0. Instead, the document part and the query string can change without affecting the choreography definition.

The syntax of the token construct is:

The attribute name is used to specify a distinct name for each token element declared within a choreography package.

The attribute informationType identifies the type of the document fragment.

The syntax of the tokenLocator construct is:

<tokenLocator tokenName="QName" informationType="QName" part="NCName"? query="XPath-expression" />

The attribute tokenName identifies the name of the token that the document fragment locator is associated.

The attribute informationType identifies the type of the document on which the query is performed to locate the token.

The OPTIONAL attribute part defines the document part on which the query is performed to locate the token. This attribute SHOULD NOT be defined for a WSDL 2.0 document.

The attribute query defines the query string that is used to select a document fragment within a document or a document part.

The example below shows that the token "purchaseOrderID" is of XML-Schema type 'int'. The two token locators show how to access this token in the "purchaseOrder" and "purchaseOrderAck" messages.

5.5 Choreography

A choreography defines re-usable common rules that govern the ordering of exchanged messages, and the provisioning patterns of collaborative behavior, as agreed upon between two or more interacting participants.

A choreography defined at the choreography package level is called a top-level choreography, and does not share its context with other top-level choreographies. A choreography package MUST contain zero or one top-level choreography, marked explicitly as the root choreography.

The re-usable behavior encapsulated within a choreography MAY be performed within an isolated enclosed choreography, thus facilitating composition. The performed choreography is then called an enclosed choreography and MAY be defined:

The root choreography is the only choreography that is enabled by default, whereas a non-root choreography is enabled only when performed.

A choreography MUST contain at least one relationshipType, enumerating the observable behavior this choreography requires its participants to exhibit. One or more relationshipTypes MAY be defined within a choreography, modeling multi-participant collaborations.

A choreography acts as a lexical name scoping context for variables. A variable defined in a choreography is visible for use in this choreography and all its enclosed choreographies up to the point that the variable is redefined as a non-free variable, thus forming a choreography visibility horizon for this variable.

A choreography MAY contain one or more choreography definitions that MAY be performed only locally within this choreography.

A choreography MUST contain an Activity-Notation. The Activity-Notation specifies the actions of the choreography that perform work. These actions are enabled when the choreography they belong to is enabled.

A choreography MAY define an exceptionBlock to recover from unusual conditions that can occur.

An enclosed choreography that has successfully completed MAY need to provide finalization actions that confirm, cancel or otherwise modify the effects of its completed actions. To handle these modifications, one or more separate finalizerBlocks MAY be defined for an enclosed choreography.

A choreography can also be coordinated. Choreography coordination guarantees that all involved roleTypes agree on how the choreography ended. That is, if the choreography completed successfully or suffered an exception, and if the choreography completed successfully and finalizerBlocks were installed, all roleTypes have the same finalizerBlock enabled.

The Choreography-Notation is used to define a choreography as follows:

<choreography name="NCName" complete="xsd:boolean XPath-expression"? isolation="true"|"false"? root="true"|"false"? coordination="true"|"false"? >

+

variableDefinitions?

Choreography-Notation*

  Activity-Notation 
WorkUnit-Notation+ ? Activity-Notation *

The attribute name is used to specify a distinct name for each choreography element declared within a choreography package.

The OPTIONAL complete attribute makes it possible to explicitly complete a choreography as described below in the choreography life-line section. This Boolean conditional expression MUST use short circuit evaluation according to the XPath 1.0 lexical rules.

The OPTIONAL isolation attribute specifies when a variable defined in an enclosing choreography, and changed within an enclosed choreography, is available to its sibling choreographies. The default value for this attribute is "false". The following rules apply:

An isolated choreography MUST NOT directly or indirectly perform another isolated choreography.

If a choreography has its isolation attribute set to "true", then any and all enclosed choreographies MUST assume this isolation value.

The OPTIONAL coordination attribute specifies whether choreography coordination is required. The default value for this attribute is "false". The following rules apply:

The relationship element within the choreography element enumerates the relationships this choreography MAY participate in.

The OPTIONAL variableDefinitions element enumerates the variables defined in this choreography.

The OPTIONAL root element marks a top-level choreography as the root choreography of a choreography package. The default value for this attribute is "false".

The OPTIONAL Choreography-Notation within the choreography element defines the locally defined choreographies that MAY be performed only within this choreography.

The OPTIONAL exceptionBlock element defines the exceptionBlock of a choreography by specifying one or more exception workunits using a WorkUnit-Notation. Within this element, the attribute name is used to specify a name for this exceptionBlock element.

The OPTIONAL finalizerBlock element defines a finalizerBlock for a choreography. A choreography MAY have more than one finalizerBlock. Each finalizerBlock specifies one finalizer activity using an Activity-Notation. If a choreography defines more than one finalizerBlock, then each MUST be differentiated by a distinct name as specified with the name attribute within the finalizerBlock element.

5.6 WorkUnit

A workunit prescribes the constraints that have to be fulfilled for making progress and thus performing work within a choreography. A workunit can also prescribe the constraints that preserve the consistency of the collaborations commonly performed between the participants. Using a workunit, an application can recover from errors that are the result of abnormal actions and can also finalize successfully completed choreographies that need further action. For example, to confirm or logically roll back effects, or to close the choreography so that any defined "rollback" workunit will not be enabled. Examples of a workunit include:

The guard condition of a workunit, if specified, expresses the interest on one or more variable's information (that already exist or will become available in the future) being available under certain prescribed constraints. The workunit's expressed interest MUST be matched for its enclosed actions to be enabled.

A workunit MUST complete successfully when all its enclosed actions complete successfully.

A workunit that completes successfully MUST be considered again for matching (based on its guard condition), if its repetition condition evaluates to "true".

The WorkUnit-Notation is used to define a workunit as follows:

<workunit name="NCName" guard="xsd:boolean XPath-expression"? repeat="xsd:boolean XPath-expression"? block="true|false"? >

  Activity-Notation 

The attribute name is used to specify a name for each workunit element declared within a choreography package.

The Activity-Notation specifies the enclosed actions within a workunit.

The OPTIONAL attribute guard specifies the guard condition of a workunit. This Boolean conditional expression MUST use short circuit evaluation according to the XPath 1.0 lexical rules.

The OPTIONAL attribute repeat specifies the repetition condition of a workunit. This Boolean conditional expression MUST use short circuit evaluation according to the XPath 1.0 lexical rules.

The OPTIONAL attribute block specifies whether the workunit has to block waiting for referenced variables within the guard condition to become available (if they are not already) and the guard condition to evaluate to "true". This attribute MUST always be set to "false" in exception workunits. The default value for this attribute is "false".

As detailed above, the following rules apply:

The examples below demonstrate some usages of a workunit:

a. Example of a workunit with block equals to "true":

In the following workunit, the guard condition waits on the availability of "POAcknowledgement" at "Customer" roleType and if it is already available, the activity happens, otherwise, the activity blocks until the variable "POAcknowledgement" becomes available at the "Customer" roleType.

...

b. Example of a workunit with block equals to "false":

In the following workunit, the guard condition checks if the variable "StockQuantity" at the "Retailer" roleType is available and is greater than 10 and if so, the activity happens. If either the variable is not available or its value is less than '10', then the matching condition is "false" and the activity is skipped.

...

c. Example of a workunit waiting for alignment to happen:

In this example the workunit waits until the "purchase order" information at the "Customer" and the "Retailer" roleTypes have been aligned based on a previous interaction. Alignment means that both roleTypes have agreement on the values of their respective "purchase order" variables:

. . . . . .

...

5.7 Choreography Life-line

A choreography life-line expresses the progression of a collaboration through enabled activities and enclosed choreographies. Initially, the collaboration is established between participants, then work is performed within it and finally it ends.

Distinct instances of a top-level or enclosed choreography, if they are ever performed in a temporarily overlapped fashion, MUST NOT interfere with each other in their involved communication actions. In other words, given a choreography description, interactions belonging to one of its instances MUST be logically, and hence operationally, distinguishable from those in another.

A choreography is initiated, establishing a collaboration when an interaction, explicitly marked as an choreography initiator, is performed. This causes the exceptionBlock to be installed and the choreography enters the Enabled State. Before this point there is no observable association between any of the participants.

Two or more interactions MAY be marked as choreography initiators, indicating alternatives for establishing a collaboration. In this case, the first performed interaction will establish the collaboration and the other interactions will enlist with the already established collaboration.

A choreography initiator interaction MAY be defined within a root choreography or within an enclosed choreography. In either case the collaboration is established when the first choreography initiator interaction is performed.

A choreography in an Enabled State MUST complete unsuccessfully when an exception is caused in the choreography and its exceptionBlock, if present, MUST be enabled. This MUST cause the choreography to enter the Unsuccessfully Completed State.

The unsuccessfully completed choreography MUST enter the Closed State once the exceptionBlock, if present, is completed. If the exceptionBlock is not present, the choreography implicitly enters the Closed State and the exception occurred MUST be propagated to the enclosing choreography, if an enclosing choreography exists.

A choreography in an Enabled State MUST complete successfully when there are no more enabled activities within its body. This causes its exceptionBlock, where present, to be deinstalled, finalizerBlocks to be installed if specified, and the choreography enters the Successfully Completed State.

Alternatively, a choreography MUST complete successfully if its complete condition, is matched by evaluating to "true". A complete condition is considered for matching while the choreography is in Enabled State. The complete condition MUST be possible to be matched in all roleTypes that participate in the choreography. When the complete condition of a choreography is matched then all activities in the choreography MUST be disabled, except for any finalizerBlocks, and the choreography completes as if there were no more enabled activities within it. When a choreography completes, all uncompleted enclosed choreographies MUST automatically become successfully completed. Messages that were sent as part of a choreography that has since completed MUST be ignored. If a finalizerBlock has been entered when the complete condition evaluates to "true", then it is unaffected and its messages MUST NOT be ignored.

A choreography, in a Successfully Completed State enters the Closed State if no finalizerBlocks were specified in that choreography.

A choreography in a Successfully Completed State with finalizerBlocks specified enters the Closed State when one of its installed finalizerBlocks is enabled and completed. The finalizerBlock of a choreography is enabled by a finalize activity in the immediately enclosing choreography. Alternatively, a choreography in a Successfully Completed State with finalizerBlocks specified implicitly enters the Closed State when its enclosing choreography enters the Closed State without enabling the finalizerBlocks of its enclosed choreography. In other words, when a choreography enters the Closed State, all its enclosed successfully completed choreographies are implicitly entering the Closed State even if none of their finalizerBlocks has been enabled.

5.8 Choreography Exception Handling

A choreography can sometimes fail as a result of an exceptional circumstance or an "error" that occurred during its performance. Different types of exceptions are possible including this non-exhaustive list:

Within WS-CDL, one or more exception workunits MAY be defined within the exceptionBlock of a choreography for each exception that needs to be handled. At least one exception workunit MUST be defined as part of the exceptionBlock of a choreography.

An exception workunit MAY express interest on the occurrence of a particular type of exception using its guard condition with the hasExceptionOccurred WS-CDL function. If no guard condition is specified, then the exception workunit is called the default exception workunit and expresses interest on any type of exception. Within the exceptionBlock of a choreography there MUST NOT be more than one default exception workunit. An exception workunit MUST always set its block attribute to "false" and MUST NOT define a repetition condition.

Exception workunits MUST be enabled when the exceptionBlock of the choreography they belong to is enabled. Enabled exception workunits in a choreography MAY behave as the mechanism to recover from exceptions occurring in this and its enclosed choreographies.

Within the exceptionBlock of a choreography only one exception workunit MAY be matched.

The rules for matching an exception are:

The actions within the exception workunit MAY use variable information visible in the visibility horizon of the choreography it belongs to as they stand at the current time.

The actions of an exception workunit MAY also cause an exception. The semantics for matching the exception and acting on it are the same as described in this section.

5.9 Choreography Finalization

After a choreography instance has successfully completed, it MAY need to provide finalization actions that confirm, cancel or otherwise modify the effects of its completed actions. To handle these modifications, one or more separate finalizerBlocks MAY be defined for an enclosed choreography. When its choreography body completes successfully, and associated finalizerBlocks are specified, the finalizerBlocks MUST be installed.

If more than one finalizerBlock is defined for the same choreography, each of them MUST be differentiated by their name attributes. However, at most one finalizerBlock MAY be enabled for any given choreography instance during the subsequent progress, including exception handling and finalization, of the enclosing choreography.

FinalizerBlocks MAY implement whatever actions are appropriate for the particular choreography. Common patterns might include:

The actions within the finalizer activity MAY use variable information visible in the visibility horizon of the choreography it belongs to as they were at the time the choreography completed for the variables belonging to this choreography and as they stand at the current time for the variables belonging to the enclosing choreography.

The actions of a finalizer activity MAY fault. The semantics for matching the fault and acting on it are the same as described in Section 5.8.

5.10 Choreography Coordination

Choreography coordination guarantees that all involved roleTypes will agree on how the choreography ended. That is, all roleTypes will agree on whether the choreography completed successfully or suffered an exception, and if the choreography completed successfully and finalizerBlocks were installed, all roleTypes will agree on which finalizerBlock was enabled. Such agreement differs from interaction based alignment in that the coordinated choreography as a whole is aligned, regardless of whether each interaction in the coordinated choreography is aligned. In contrast to alignment interactions, a coordinated choreography provides a larger unit of coordination - a set of interactions that end with shared knowledge among all the participantTypes that their collaboration is in a defined state. Such a unit need not be aligned at each step - it is only required that clear alignment points are made to guarantee that all involved roleTypes will agree on how the choreography ended.

Choreographies defined as requiring coordination must be bound to a coordination protocol. When choreography coordination is not required, then the choreography is not bound to a coordination protocol and, since none of the above guarantees of agreement on the outcome apply, any required coordination should be performed using explicitly modeled interactions.

The implications of choreography coordination differ for root choreographies versus enclosed choreographies:

An exception MUST be propagated to all participants in the choreography using explicitly modeled, exception causing interactions when the choreography is not coordinated. This MUST cause the choreography to enter the exception state, and its exceptionBlock, if specified, MUST be enabled.

The two examples below show two usages of coordinated choreographies.

Example 1: Coordinated credit authorization without finalizerBlocks:

Example 2: Coordinated credit authorization with finalizerBlocks

6 Activities

Activities describe the actions performed within a choreography. The Activity-Notation is used to define activities as either:

6.1 Ordering Structures

Ordering structures combine activities with other ordering structures in a nested structure to express the ordering rules of actions performed within a choreography. An ordering structure is one of the following:

6.1.1 Sequence

The sequence ordering structure contains one or more Activity-Notations. When the sequence activity is enabled, the sequence element MUST restrict the series of enclosed activities (as defined by one or more Activity-Notations) to be enabled sequentially, in the same order that they are defined.

The syntax of this construct is:

Activity-Notation+

6.1.2 Parallel

The parallel ordering structure contains one or more Activity-Notations that are enabled concurrently when the parallel activity is enabled. The parallel activity MUST complete successfully when all activities (as defined by one or more Activity-Notations) performing work within it complete successfully.

The syntax of this construct is:

Activity-Notation+

6.1.3 Choice

The choice ordering structure enables specifying that only one of two or more activities (as defined by two or more Activity-Notations) SHOULD be performed.

When two or more activities are specified in a choice element, only one activity is selected and the other activities are disabled. If the choice has workunits with guard conditions, the first workunit that matches the guard condition is selected and the other workunits are disabled. Where there is more than one match, lexical ordering is used to select a match. If the choice has other activities, it is assumed that the selection criteria for those activities are non-observable.

The syntax of this construct is:

Activity-Notation+

In the example below, choice element has two interactions, "processGoodCredit" and "processBadCredit". The interactions have the same directionality, participate within the same relationshipType and have the same fromRoleTypeRef and toRoleTypeRef names. If one interaction happens, then the other one is disabled.

...

<interaction name=""processBadCredit" channelVariable="badCredit-channel" operation="doBadCredit"> ...

6.2 Interacting

An interaction is the basic building block of a choreography. It results in information exchanged between collaborating participants and possibly the synchronization of their observable information changes and the values of the exchanged information.

An interaction forms the base atom of the choreography composition. Multiple interactions are combined to form a choreography, which can then be used in different business contexts.

An interaction is initiated when one of the roleTypes participating in the interaction sends a message through a common channel to another roleType that is participating in the interaction. If the initial message is a request, then the accepting roleType can optionally respond with a normal response message or a fault message, which will be received by the initiating roleType.

An interaction also contains "references" to:

6.2.1 Interaction Based Information Alignment

In some choreographies there may be a requirement that when the interaction is performed, the roleTypes in the choreography have agreement on the outcome. More specifically within an interaction, a roleType may need to have a common understanding of the observable information creations or changes of one or more state capturing variables that are complementary to one or more state capturing variables of its partner roleType. Additionally, within an interaction a roleType may need to have a common understanding of the values of the information exchange capturing variables at the partner roleType.

For example, after an interaction happens, both the "Buyer" and the "Seller" want to have a common understanding that:

In WS-CDL, an alignment interaction MUST be explicitly used in the cases where two interacting participants require the alignment of their observable information changes and the values of their exchanged information. After the alignment interaction completes, both participants progress at the same time in a lock-step fashion, and the variable information in both participants is aligned. Their variable alignment comes from the fact that the requesting participant has to be assured that the accepting participant has received the message, and the accepting participant has to be assured that the requesting participant has sent the message before both of them progress. There is no intermediate state, where one participant sends a message and then it proceeds independently, or the other participant receives a message and then it proceeds independently. In other words, after each alignment interaction both participants act on the basis of their shared understanding for the messages exchanged and the information recorded.

6.2.2 Interaction Life-line

An interaction MUST complete normally when its message exchanges complete successfully.

An interaction MUST complete abnormally when:

6.2.3 Interaction Syntax

The syntax of the interaction construct is:

<interaction name="NCName" channelVariable="QName" operation="NCName" align="true"|"false"? initiate="true"|"false"? >

<exchange name="NCName" faultName="QName"? informationType="QName"?|channelType="QName"? action="request"|"respond" > <send variable="XPath-expression"? recordReference="list of NCName"?
causeException="QName"? /> <receive variable="XPath-expression"? recordReference="list of NCName"? causeException="QName"? /> *

<timeout time-to-complete="XPath-expression" fromRoleTypeRecordRef="list of NCName"? toRoleTypeRecordRef="list of NCName"? />?

<record name="NCName" when="before"|"after"|"timeout" causeException="QName"? > <source variable="XPath-expression"? | expression="XPath-expression"? /> *

The attribute name is used to specify a name for each interaction element declared within a choreography.

The channelVariable attribute specifies the channel capturing variable used for communicating during this interaction. The channel variable contains information about the participant that is the target of the interaction. The information is used for determining where and how to send and receive information to and from the participant. The channel variable used in an interaction MUST be available at the two roleTypes before the interaction MAY occur. At runtime, information about a channel variable is expanded further. This requires that the messages exchanged in the choreography also contain reference and correlation information, for example by:

The operation attribute specifies the name of the operation that is associated with this interaction. The specified operation belongs to the interface, as identified by the roleType and behavior elements of the channelType specified in the channel variable used in this interaction.

The OPTIONAL align attribute, when set to "true", means that this alignment interaction results in the common understanding of both the information exchanged and the resulting observable information creations or changes at the ends of the interaction, as specified in the fromRoleTypeRef and the toRoleTypeRef elements. In other words, after each alignment interaction both participants act on the basis of their shared understanding for the messages exchanged and the information recorded. The default value for this attribute is "false".

When the OPTIONAL initiate attribute is set to "true", an interaction activity MUST be marked as a choreography initiator. The default value for this attribute is "false".

Within the participate element, the relationshipType attribute specifies the relationshipType this interaction participates in, and the fromRoleTypeRef and toRoleTypeRef attributes specify the requesting and the accepting roleTypes respectively. The type of the roleType identified by the toRoleTypeRef attribute MUST be the same as the roleType identified by the roleType element of the channelType specified in the channel variable used in the interaction.

The OPTIONAL exchange element allows information to be exchanged during an interaction. The attribute name is used to specify a name for this exchange element.

Within the exchange element, the OPTIONAL faultName attribute is used to identify this exchange element as a fault exchange with the specified name. If the faultName attribute is specified, then it will be used to identify the specific fault within the context of the operation. If the operation is defined using WSDL, this MUST occur in the following way:

Within the exchange element, the OPTIONAL attributes informationType and channelType identify the informationType or the channelType of the information that is exchanged between the two roleTypes in an interaction. The attributes informationType and channelType MUST be mutually exclusive. If none of these attributes are specified, then it is assumed that either no actual information is exchanged or the type of information being exchanged is of no interest to the choreography definition.

Within the exchange element, the attribute action specifies the direction of the information exchanged in the interaction:

Within the exchange element, the send element shows that information is sent from a roleType and the receive element shows that information is received at a roleType respectively in the interaction:

Within the OPTIONAL timeout element, the time-to-complete attribute identifies the timeframe within which an interaction MUST complete after it was initiated, or the deadline before which an interaction MUST complete. When the time-to-complete has been exceeded, a time-to-complete timeout occurs after the interaction was initiated, but before it completed. The time-to-complete SHOULD be of XML-Schema duration type when conveying the timeframe and SHOULD be of XML-Schema dateTime type when conveying the deadline. When used, the OPTIONAL fromRoleTypeRecordRef attribute contains an XML-Schema list of references to record elements in the same interaction that SHOULD take effect at the 'from' roleType when a timeout occurs. When used, the OPTIONAL toRoleTypeRecordRef attribute contains an XML-Schema list of references to record elements in the same interaction that SHOULD take effect at the 'to' roleType when a timeout occurs.

The OPTIONAL record element is used to create or change and then make available within one roleType, the value of one or more variables using another variable or an expression. The attribute name is used to specify a distinct name for a record element within an interaction. Within the record element, the source and target elements specify these recordings of information happening at the send and receive ends of the interaction:

Within the record element, the when attribute specifies if a recording happens before or after the send, or before or after the receive of a message at a roleType in a Request or a Response exchange or when a timeout has expired. When the when attribute is set to "timeout", the record element specifies the recording to be performed when a timeout occurs. If two or more record elements have the same value in their when attribute and are referenced within the recordReference attribute of a send or a receive element, then they are performed in the order in which they are specified.

The following rules apply for the information recordings when using the record element:

The example below shows a complete choreography that involves one interaction performed from a roleType "Consumer" to a roleType "Retailer" on the channel "retailer-channel" as a request/response exchange:

<interaction name="createPO"
             channelVariable="tns:retailer-channel" 
             operation="handlePurchaseOrder" >
  <participate relationshipType="tns:ConsumerRetailerRelationship" 
               fromRoleTypeRef="tns:Consumer" toRoleTypeRef="tns:Retailer"/>
  <exchange name="request" 
            informationType="tns:purchaseOrderType" action="request">
    <send variable="cdl:getVariable('tns:purchaseOrder','','')" />
    <receive variable="cdl:getVariable('tns:purchaseOrder','','')"
             recordReference="record-the-channel-info" />
  </exchange>
  <exchange name="response"
            informationType="purchaseOrderAckType" action="respond">
    <send variable="cdl:getVariable('tns:purchaseOrderAck','','')" />
    <receive variable="cdl:getVariable('tns:purchaseOrderAck','','')" />
  </exchange>
  <exchange name="badPurchaseOrderAckException" faultName="badPurchaseOrderAckException"
            informationType="badPOAckType" action="respond">
    <send variable="cdl:getVariable('tns:badPurchaseOrderAck','','')"
            causeException="tns:badPOAck" />
    <receive variable="cdl:getVariable('tns:badPurchaseOrderAck','','')"
            causeException="tns:badPOAck" />                 
  </exchange>
  <record name="record-the-channel-info" when="after">
    <source variable="cdl:getVariable('tns:purchaseOrder','', 
                                      '/PO/CustomerRef')"/>
    <target variable="cdl:getVariable('tns:consumer-channel','','')"/>
  </record>
</interaction>

6.3 Composing Choreographies

The perform activity realizes the composition of choreographies by combining existing choreographies to create new ones. For example, if two separate choreographies were defined as follows:

One could then create a new "Quote and Order" choreography by reusing the two, where the "RFQ" choreography was performed first, and then, depending on the outcome of the "RFQ" choreography, the order is placed using the "Order Placement" choreography. In this case the new choreography is "composed" using the two previously defined choreographies. Using this approach, choreographies can be combined to support choreographies of any required complexity, allowing more flexibility as choreographies defined elsewhere can be reused.

The perform activity enables a choreography to specify that another choreography is performed at this point in its definition, as an enclosed choreography. The performed choreography, even when defined in a different choreography package, is conceptually treated as an enclosed choreography.

The syntax of the perform construct is:

<perform choreographyName="QName" choreographyInstanceId="XPath-expression"? block="true|false"? > * Choreography-Notation?

Within the perform element, the choreographyName attribute references the name of the choreography to be performed.

The OPTIONAL choreographyInstanceId attribute defines an identifier for this performance of the choreography identified by the choreographyName attribute. If the performed choreography can only be performed once within the enclosing choreography, the choreographyInstanceId attribute is OPTIONAL. Otherwise it MUST be specified and the value MUST be different for each performance. This is a dynamic requirement. For example, if a single perform element appears in a workunit that can repeat, then each use of perform must assign a different choreographyInstanceId identifier.

The OPTIONAL block attribute is used to indicate whether the performing choreography should wait for the performed choreography to complete before the perform activity completes:

If the block attribute is set to "true", then the perform activity MUST wait for the performed choreography to complete

If the block attribute is set to "false", then the perform activity MUST complete immediately following the enablement of the performed choreography, which may cause the performed choreography to be active concurrently with other activities following the perform activity

The default value for the block attribute is "true". For the purpose of clarity, any non-blocking performed enclosed choreographies that have not completed prior to the end of the performing choreography, are considered to be successfully completed upon the completion of the performing choreography.

The OPTIONAL Choreography-Notation within the perform element defines a locally defined choreography that is performed only by this perform activity. If specified, the choreographyName attribute within the perform element MUST match the attribute name within the choreography element of the Choreography-Notation.

The OPTIONAL bind element within the perform element enables information in the performing choreography to be shared with the performed choreography and vice versa. Within the bind element, the attribute name is used to specify a name for each bind element declared within this perform activity. Within the bind element, the roleType attribute aliases the roleTypes from the performing choreography to the performed choreography.

The variable attribute within the this element specifies that a variable in the performing choreography is bound with the variable identified by the variable attribute within the free element in the performed choreography.

The following rules apply:

The example below shows a choreography composition, where a choreography "PurchaseChoreography" is performing the globally defined choreography "RetailerWarehouseChoreography" and aliases the variable "purchaseOrderAtRetailer" to the variable "purchaseOrder" defined at the performed choreography "RetailerWarehouseChoreography". Once aliased, the variable "purchaseOrderAtRetailer" extends to the enclosed choreography and thus these variables can be used interchangeably for sharing their information.

... ... ... ...

6.4 Assigning Variables

The Assign activity is used to create or change, and then make available within one roleType, the value of one or more variables using the value of another variable or expression.

The assign activity MAY also be used to cause an exception at a roleType.

The syntax of the assign construct is:

+

The copy element within the assign element creates or changes, at the roleType specified by the roleType attribute, the variable defined by the target element using the variable or expression defined by the source element at the same roleType. Within the copy element, the attribute name is used to specify a name for each copy element declared within this assign activity.

The following rules apply to assignment:

The examples below show some possible usages of the assign construct.

Example 1:

Example 2:

   

Example 3:

   

6.5 Marking Silent Actions

The silentAction activity is an explicit designator used for marking the point where participant specific actions with non-observable operational details MUST be performed. For example, the mechanism a "Buyer" is using for checking the inventory of a warehouse should not be observable to other participants, but the fact that the inventory level does influence the global observable behavior with a "Buyer" needs to be specified in the choreography definition.

The syntax of the silentAction construct is:

<silentAction roleType="QName"? />

The OPTIONAL attribute roleType is used to specify the participant at which the silentAction will be performed. If a silent action is defined without a roleType, it is implied that the action is performed at all the roleTypes that are part of the relationships of the choreography this activity is enclosed within.

6.6 Marking the Absence of Actions

The noAction activity is an explicit designator used for marking the point where a participant does not perform any action. The noAction activity can be used in scenarios where an activity is syntactically required but no activity is applicable, in an exceptionBlock as demonstrated in the example below.

The syntax of the noAction construct is:

<noAction roleType="QName? />

The OPTIONAL attribute roleType is used to specify the participant at which no action will be performed. If a noAction is defined without a roleType, it is implied that no action will be performed at any of the roleTypes that are part of the relationships of the choreography this activity is enclosed within.

6.7 Finalizing a Choreography

The finalize activity is used to enable a specific finalizerBlock in successfully completed instances of immediately enclosed choreographies, and thus bring those choreographies to defined conclusions.

A choreography that does not perform any choreographies that have finalizerBlocks defined MUST NOT have any finalize activities specified within it. A finalize activity MAY be present within a choreography that has performed a choreography with one or more defined finalizerBlocks - that is a finalize activity can be specified within the choreography body, within an exceptionBlock and within finalizerBlocks.

For a single performed choreography instance, at most one of its finalizerBlocks SHOULD be enabled by a finalize activity during the subsequent progress, including exception handling and finalization, of the enclosing choreography. A finalize activity performed on uninstalled finalizerBlocks will have no effect.

The syntax of the finalize construct is:

<finalize name="NCName"? choreographyName="NCName" choreographyInstanceId="XPath-expression"? finalizerName="NCName"? />

The OPTIONAL attribute name is used to specify a distinct name for each finalize element declared within a choreography package.

The finalize activity enables a finalizerBlock in a performed instance of an immediately enclosed choreography.

The choreographyName attribute identifies the choreography referenced by the choreographyName attribute of the perform construct.

The OPTIONAL choreographyInstanceId attribute identifies the performed choreography instance to be finalized, using the value defined by the choreographyInstanceId attribute of the perform construct. The choreographyInstanceId attribute MAY be omitted if the contract logic of the performing choreography is such that only one instance of the choreography identified by the choreographyName attribute could have been performed when the finalize activity is enabled. If more than one instance of the choreography identified by the choregraphyName attribute could have been performed, then the choreographyInstanceId attribute MUST be present.

The attribute finalizerName indicates which finalizerBlock is to be enabled in the performed instance. If the targeted, immediately enclosed, choreography has more than one defined finalizerBlock, then the finalizerName attribute MUST be present.

In the example below, choreography "CreditDecider" gets credit authorizations for two bidders, "A" and "B", at most one of which can be selected. The "CreditDecider" performs a "CoordinatedCreditAuthorization" choreography for each bidder, and then finalizes each performed choreography depending on whether "A", "B" or neither was selected.

<!-- only a snippet is shown here -->

<parallel>
    <perform name="creditForA"
        choreographyName="CoordinatedCreditAuthorization" 
        choreographyInstanceId="'creditForA'">
        <!-- bind such that this does the business for A -->
    </perform>
    <perform name="creditForB"
        choreographyName="CoordinatedCreditAuthorization" 
        choreographyInstanceId="'creditForB'">
        <!-- bind such that this does the business for B -->
    </perform>
</parallel>
    
<!--  other stuff here -->

<workunit name="chooseA"
    guard="cdl:getVariable('Chosen','','','Broker')='A'" >
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForA'"
            finalizerName="drawDown"/>
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForB'"
            finalizerName="replenish"/>
</workunit>            

<workunit name="chooseB"
    guard="cdl:getVariable('Chosen','','','Broker')='B'" >
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForB'"
            finalizerName="drawDown"/>
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForA'"
            finalizerName="replenish"/>
</workunit>            

<workunit name="chooseNeither"
    guard="cdl:getVariable('Chosen','','','Broker')='0'" >
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForA'"
            finalizerName="replenish"/>
    <finalize choreographyName="CoordinatedCreditAuthorization"
            choreographyInstanceId="'creditForB'"
            finalizerName="replenish"/>
 </workunit> 

7 Interoperability with other Specifications

7.1 Interoperability with Security frameworks

Security specifications, such as WS-Security [WSS], provide enhancements to SOAP messaging to provide quality of protection through message integrity, message confidentiality, and single message authentication, including a general-purpose mechanism for associating security tokens with messages, and a description of how to encode binary security tokens.

As messages can have consequences in the real world, collaboration participants will impose security requirements on their information exchanges. WS-Security and other security specifications can be used satisfy many of these requirements.

A violation of any of the security consistency guarantees provided by the security specifications results in "errors" which MAY be reflected in the choreography as exceptions, identified by different "QNames".

7.2 Interoperability with Reliable Messaging frameworks

Reliability specifications, such as WS-Reliability [WSRM] and WS-ReliableMessaging [WSRM], provide a reliable mechanism to exchange information among collaborating participants. These specifications prescribe the formats for all information exchanged without placing any restrictions on the content of the encapsulated business documents. These specifications support message exchange patterns over various transport protocols (examples are HTTP/S, FTP, SMTP, etc.). These specifications support sequencing of messages and guaranteed, exactly once delivery.

A violation of any of these consistency guarantees results in "errors" which MAY be reflected in the choreography as exceptions, identified by different "QNames".

7.3 Interoperability with Coordination frameworks

In WS-CDL, alignment interactions and coordinated choreographies require support from a coordination protocol, where agreement on the outcome among participants can be reached even in the case of failures and loss of messages. In this case, the alignment interactions and the coordinated choreographies MUST be bound to a coordination protocol.

7.4 Interoperability with Addressing frameworks

Web Services Addressing [WSAD] provides transport-neutral mechanisms to address Web services and messages. Web Services Addressing 1.0 - Core defines a set of abstract properties and an XML Infoset [XML], [XMLNS] representation thereof to identify Web service endpoints and to facilitate end-to-end identification of endpoints in messages. The specification enables messaging systems to support message transmission through networks that include processing nodes such as endpoint managers, firewalls, and gateways in a transport-neutral manner.

WS-Addressing can be used to convey the reference and correlation information for normalizing expanded channel variable information into a uniform format that can be processed independently of transport or application.

The WS-Addressing specification is in progress and the WS-Choreography Working Group will review and comment on developments of this effort on an ongoing basis.

8 Conformance

8.1 Conforming WS-CDL documents

A WS-CDL document conforms to the schema in Appendix B (Section 12) plus the additional syntactic and semantic constraints defined in the specification text in sections 2 through 6. The root element MUST be <package> and it MUST belong to the WS-CDL namespace.

8.2 Endpoint conformance

A conformant WS-CDL endpoint is an entity that correctly implements the observable behavior of a roleType defined within a WS-CDL choreography.

9 Acknowledgments

This document has been produced by the members of the Web Services Choreography Working Group. The chairs of this Working Group are Martin Chapman (Oracle Corporation) and Steve Ross-Talbot (Pi4 Technologies Ltd). The editors would like to thank the Working Group members for their contributions. Members of the Working Group are (at the time of writing): Daniel Austin (Sun Microsystems, Inc.), Abbie Barbir (Nortel Networks), Charlton Barreto (Adobe Systems, Inc), Carine Bournez (W3C), Gary Brown (Pi4 Technologies Ltd), Ugo Corda (SeeBeyond Technology Corporation), Anthony Fletcher (Choreology Ltd), Peter Furniss (Choreology Ltd), Kohei Honda (Queen Mary and Westerfield College), Duncan Johnston-Watt (Enigmatec Corporation), Nickolas Kavantzas (Oracle Corporation), Yves Lafon (W3C), Monica Martin (Sun Microsystems, Inc.), Robin Milner (Cambridge University), Jeff Mischkinsky (Oracle Corporation), Greg Ritzinger (Novell), Nobuko Yoshida (Imperial College London). Previous members of the Working Group were: Assaf Arkin (Intalio Inc.), Alistair Barros (DSTC Pty Ltd (CITEC)), Richard Bonneau (IONA), Allen Brown (Microsoft Corporation), Mike Brumbelow (Apple), David Burdett (Commerce One), Ravi Byakod (Intalio Inc.), Michael Champion (Software AG), David Chapell (Sonic Software), Fred Cummins (EDS), Jon Dart (TIBCO Software), Jean-Jacques Dubray (Attachmate), William Eidson (TIBCO Software), Colleen Evans (Sonic Software), Keith Evans (Hewlett-Packard), Yaron Goland (BEA Systems), Leonard Greski (W. W. Grainger, Inc.), Jim Hendler (University of Maryland (Mind Lab)), Ricky Ho (Cisco Systems Inc.), Andre Huertas (Uniform Code Council), Eunju Kim (National Computerization Agency), Mayilraj Krishnan (Cisco Systems Inc.), Melanie Kudela (Uniform Code Council), Yutaka Kudou (Hitachi, Ltd.), Bruno Kurtic (webMethods, Inc.), Paul Lipton (Computer Associates), Kevin Liu (SAP AG), Francis McCabe (Fujitsu Ltd.), Carol McDonald (Sun Microsystems, Inc.), Greg Meredith (Microsoft Corporation), Eric Newcomer (IONA), Bijan Parsia (University of Maryland (Mind Lab)), Sanjay Patil (IONA), Ed Peters (webMethods, Inc.), Steve Pruitt (Novell), Yoko Seki (Hitachi, Ltd.), Dinesh Shahane (TIBCO Software), Evren Sirin (University of Maryland (Mind Lab)), Ivana Trickovic (SAP AG), William Vambenepe (Hewlett-Packard), Jim Webber (Arjuna Technologies Ltd.), Stuart Wheater (Arjuna Technologies Ltd.), Steven White (SeeBeyond Technology Corporation), Prasad Yendluri (webMethods, Inc.), Hadrian Zbarcea (IONA).

10 References

10.1 Normative References

RFC 3023

XML Media Types, M. Murata, S. St.Laurent and D. Kohn, Editors. IETF, January 2001. This RFC is available at http://www.ietf.org/rfc/rfc3023.txt.

RFC 2119

Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, Editor. IETF, March 1997. This RFC is available at http://www.ietf.org/rfc/rfc2119.txt.

RFC 3986

Uniform Resource Identifiers (URI): Generic Syntax, T. Berners-Lee, R. Fielding and L. Masinter, Editors. IETF, January 2005. Obsoletes: RFC 2396, RFC 2732. This RFC is available at http://www.ietf.org/rfc/rfc3986.txt.

Extensible Markup Language (XML) 1.0 (Third Edition)

Extensible Markup Language (XML) 1.0 (Third Edition), Jean Paoli, Eve Maler, Tim Bray, et. al., Editors. World Wide Web Consortium, 04 February 2004. This version is http://www.w3.org/TR/2004/REC-xml-20040204\. The latest version is available at http://www.w3.org/TR/REC-xml.

Extensible Markup Language (XML) 1.1

Extensible Markup Language (XML) 1.1, François Yergeau, John Cowan, Tim Bray, et. al., Editors. World Wide Web Consortium, 04 February 2004. This version is http://www.w3.org/TR/2004/REC-xml11-20040204/. The latest version is available at http://www.w3.org/TR/xml11/.

Namespaces in XML

Namespaces in XML, Andrew Layman, Dave Hollander, and Tim Bray, Editors. World Wide Web Consortium, 14 January 1999. This version is http://www.w3.org/TR/1999/REC-xml-names-19990114\. The latest version is available at http://www.w3.org/TR/REC-xml-names.

XML Schema Part 1: Structures Second Edition

XML Schema Part 1: Structures Second Edition, David Beech, Murray Maloney, Henry S. Thompson, and Noah Mendelsohn, Editors. World Wide Web Consortium, 28 October 2004. This version is http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The latest version is available at http://www.w3.org/TR/xmlschema-1/.

XML Schema Part 2: Datatypes Second Edition

XML Schema Part 2: Datatypes Second Edition, Ashok Malhotra and Paul V. Biron, Editors. World Wide Web Consortium, 28 October 2004. This version is http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/. The latest version is available at http://www.w3.org/TR/xmlschema-2/.

XPointer Framework

XPointer Framework, Paul Grosso, Eve Maler, Jonathan Marsh, and Norman Walsh, Editors. World Wide Web Consortium, 25 March 2003. This version is http://www.w3.org/TR/2003/REC-xptr-framework-20030325/. The latest version is available at http://www.w3.org/TR/xptr-framework/.

XML Inclusions (XInclude) Version 1.0

XML Inclusions (XInclude) Version 1.0, Jonathan Marsh and David Orchard, Editors. World Wide Web Consortium, 20 December 2004. This version is http://www.w3.org/TR/2004/REC-xinclude-20041220/. The latest version is available at http://www.w3.org/TR/xinclude/.

Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language

Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language, Sanjiva Weerawarana, Roberto Chinnici, Martin Gudgin, et. al., Editors. World Wide Web Consortium, 03 August 2005. This version is http://www.w3.org/TR/2005/WD-wsdl20-20050803\. The latest version is available at http://www.w3.org/TR/wsdl20.

Basic Profile

Basic Profile Version 1.1, Keith Ballinger, David Ehnebuske, Christopher Ferris et. al., Editors. The Web Services-Interoperability Organization, 24 September 2004. This version is http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html. The latest version is available at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

10.2 Informative References

SOAP Version 1.2 Part 1: Messaging Framework

SOAP Version 1.2 Part 1: Messaging Framework, Marc Hadley, Noah Mendelsohn, Jean-Jacques Moreau, et. al., Editors. World Wide Web Consortium, 24 June 2003. This version is http://www.w3.org/TR/2003/REC-soap12-part1-20030624/. The latest version is available at http://www.w3.org/TR/soap12-part1/.

Processing XML 1.1 documents with XML Schema 1.0 processors

Processing XML 1.1 documents with XML Schema 1.0 processors, Henry S. Thompson , Editor. World Wide Web Consortium, 11 May 2005. This version is http://www.w3.org/TR/2005/NOTE-xml11schema10-20050511/. The latest version is available at http://www.w3.org/TR/xml11schema10.

UDDI v3

UDDI Version 3.0.2, Luc Clement, Andrew Hately, Claus von Riegen, Tony Rogers, Editors. OASIS Open, 19 October 2004. This version is http://uddi.org/pubs/uddi-v3.0.2-20041019.htm. The latest version is available at http://uddi.org/pubs/uddi\_v3.htm

Web Service Choreography Interface (WSCI) 1.0

Web Service Choreography Interface (WSCI) 1.0, Assaf Arkin, Sid Askary, Scott Fordin, et. al., Editors. W3C Note. This version is http://www.w3.org/TR/2002/NOTE-wsci-20020808. The latest version is available at http://www.w3.org/TR/wsci.

XLANG

XLANG, Satish Thatte, Author. Microsoft Corporation, 2001. This document is available at http://www.gotdotnet.com/team/xml\_wsspecs/xlang-c/default.htm.

WSFL 1.0

Web Services Flow Language (WSFL) Version 1.0, Frank Leymann, Editor. IBM, May 2001. This PDF document is available at http://www-3.ibm.com/software/solutions/webservices/pdf/WSFL.pdf.

WS-BPEL 2.0

Web Services Business Process Execution Language Version 2.0, Assaf Arkin, Sid Askary, Ben Bloch, et. al., Editors. OASIS Open, December 2004. This document is available at http://www.oasis-open.org/committees/download.php/10347/wsbpel-specification-draft-120204.htm.

BPML 1.0

Business Process Modeling Language, Assaf Arkin, Editor. BPMI.org, November 2002. This document is available at http://www.bpmi.org/downloads/BPML1.0.zip.

WPDI XML PDL

Workflow Process Definition Interface -- XML Process Definition Language, Roberta Norin, Editor. The Workflow Management Coalition, October 2002. This pdf document is available at http://www.wfmc.org/standards/docs/TC-1025\_10\_xpdl\_102502.pdf.

WS-CAF 1.0

OASIS Web Services Composite Application Framework (WS-CAF) TC, This TC page is available at http://www.oasis-open.org/committees/tc\_home.php?wg\_abbrev=ws-caf.

WS-Reliability 1.1

WS-Reliability 1.1, Kazunori Iwasa, Jacques Durant, Tom Rutt, et. al., Editors. OASIS Open, August 2004. This document is available at http://www.oasis-open.org/committees/download.php/9330/WS-Reliability-CD1.086.zip.

Java Language Specification

Java Language Specification, James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Editors. Sun Microsystems, Inc., 2000. This document is available at http://java.sun.com/docs/books/jls/second\_edition/html/j.title.doc.html.

WS-Security TC

OASIS Web Services Security (WSS) TC , This TC page is available at http://www.oasis-open.org/committees/tc\_home.php?wg\_abbrev=wss.

Java 2 Entreprise Edition

Java 2 Platform, Enterprise Edition (J2EE), See http://java.sun.com/j2ee/.

C# Language Specification

C# Language Specification, ECMA.. This document is available at http://www.ecma-international.org/publications/standards/Ecma-334.htm.

Web Services Addressing - Core

Web Services Addressing - Core, Martin Gudgin, Marc Hadley, Editors. World Wide Web Consortium, 17 August 2005. This version is http://www.w3.org/TR/2005/CR-ws-addr-core-20050817\. The latest version is available at http://www.w3.org/TR/ws-addr-core.

Resource Description Framework (RDF): Concepts and Abstract Syntax

Resource Description Framework (RDF): Concepts and Abstract Syntax, Graham Klyne, Jeremy J. Carroll, Editors. World Wide Web Consortium, 10 February 2004. This version is http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/. The latest version is available at http://www.w3.org/TR/rdf-concepts/.

OWL Web Ontology Language Overview

OWL Web Ontology Language Overview, Deborah L. McGuinness, Frank van Harmelen, Editors. World Wide Web Consortium, 10 February 2004. This version is http://www.w3.org/TR/2004/REC-owl-features-20040210/. The latest version is available at http://www.w3.org/TR/owl-features/.

UN/CEFACT Modelling Methodology

UN/CEFACT Modelling Methodology - Introduction, United Nations Economic Commission for Europe, 10 January 2005. This document is available at http://www.unece.org/cefact/umm/ch1\_intro.pdf

ebBP 2.0

OASIS ebXML Business Process TC, This TC page is available at http://www.oasis-open.org/committees/tc\_home.php?wg\_abbrev=ebxml-bp.

BPSS 1.1

Business Process Specification Schema v1.01, Business Process Project Team, UN/CEFACT and OASIS, 11 May 2001. This version is http://www.ebxml.org/specs/ebBPSS.pdf.