W3C

Web Services Choreography Description Language Version 1.0

W3C Working Draft 17 December 2004Candidate Recommendation 9 November 2005

This version:
http://www.w3.org/TR/2004/WD-ws-cdl-10-20041217/http://www.w3.org/TR/2005/CR-ws-cdl-10-20051109/
Latest version:
http://www.w3.org/TR/ws-cdl-10/
Previous version:
http://www.w3.org/TR/2004/WD-ws-cdl-10-20041012/http://www.w3.org/TR/2004/WD-ws-cdl-10-20041217/
Editors:
Nickolas Kavantzas, Oracle
David Burdett, Commerce One
Gregory Ritzinger, Novell
Tony Fletcher, Choreology
Yves Lafon, W3C
Charlton Barreto, Adobe Systems Incorporated

Abstract

The Web Services Choreography Description Language (WS-CDL) is an XML-based language that describes peer-to-peer collaborations of partiesparticipants by defining, from a global viewpoint, their common and complementary observable behavior; where ordered message exchanges result in accomplishing a common business goal.

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 Services Choreography specification is targeted for composing interoperable, peer-to-peer collaborations between any type of partyparticipant regardless of the supporting platform or programming model used by the implementation of the hosting environment.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is a Last Call Working Draft ofthe Web9 November 2005 W3C Candidate Recommendation of "Web Services Choreography Description Language document. The Last Call review period endsLanguage, Version 1.0". W3C publishes a technical report as a Candidate Recommendation to indicate that the document is believed to be stable and to encourage implementation by the developer community. Candidate Recommendation status is described in section 7.1.1 of the Process Document. Comments can be sent until 31 January 2005.March 2006. Comments on this document should be sent to public-ws-chor-comments@w3.org (public archive). It is inappropriate to send discussion emails to this address.

Discussion of this document takes place on the public public-ws-chor@w3.org mailing list (public archive) per the email communication rules in the Web Services Choreography Working Group charter.

It has been produced by the Web Services Choreography Working Group, which is part of the Web Services Activity.

This document is a chartered deliverable of the Web Services Choreography Working Group. Issues are recorded in the group's issue section.

The Working Group identified two issues . Those issues may be dropped or fixed in the future, but the Working Group does not believe that the resolution will result in a substantive change.This document is based upon the Last Call Working Draft published on 12 October17 December 2004. Changes between these two versions are described in a diff document.

The specific entrance criteria to the Proposed Recommendation phase shall be as follows:
There MUST be examples that exhibit all of the key features of WS-CDL such that the examples:

Where "valid WS-CDL" means that it conforms to the specification both in terms of the schema and the operational semantics of WS-CDL.
Where "implementations" mean tools that process WS-CDL documents and produce end-point(s).
Where "end point" means a web service.
Where "platform" means a software stack capable of supporting the execution of a web service.
Where "interoperate" means two web services playing at least two distinct roles.
Interoperability concerns such as alignment protocol, coordination protocol and adressing are implementation details.

Detailed implementation requirements and the invitation for participation in the Implementation Report are provided in the Implementation Report Plan

This document has been produced under the 24 January 2002 CPP as amended by the W3C Patent Policy Transition Procedure. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification should disclose the information in accordance with section 6 of the W3C Patent Policy. Patent disclosures relevant to this specification may be found on the Working Group's patent disclosure page.

Publication as a Working DraftCandidate Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Table of Contents

1 Introduction
    1.1 Notational Conventions
    1.2 Purpose of the Choreography Description LanguageWS-CDL
    1.3 Goals
    1.4 Relationship with XML and WSDL
    1.5 Relationship with Business Process Languages
    1.6 Time Assumptions
    1.7 Authoritative Schema
2 Choreography Description Language Model     2.1WS-CDL Model Overview
    2.23 WS-CDL Document Structure
        2.2.1    3.1 Choreography Package
        2.2.2    3.2 Including WS-CDL Type Definitions
        2.2.3    3.3 WS-CDL document Naming and Linking
        2.2.4    3.4 Language Extensibility
and Binding         2.2.5    3.5 Semantics
    2.34 Collaborating Parties         2.3.1 Role Types         2.3.2 Relationship Types         2.3.3 Participant Types         2.3.4 Channel Types     2.4Participants
    4.1 RoleType
    4.2 RelationshipType
    4.3 ParticipantType
    4.4 ChannelType
5 Information Driven Collaborations
        2.4.1 Information Types         2.4.2    5.1 InformationType
    5.2 Variables
        2.4.3    5.3 Expressions
            2.4.3.1        5.3.1 WS-CDL Supplied Functions
        2.4.4 Tokens         2.4.5 Choreographies         2.4.6 WorkUnits         2.4.7    5.4 Token and TokenLocator
    5.5 Choreography
    5.6 WorkUnit
    5.7 Choreography Life-line
        2.4.8    5.8 Choreography Exception Handling
        2.4.9    5.9 Choreography Finalization
        2.4.10    5.10 Choreography Coordination
    2.56 Activities
        2.5.1    6.1 Ordering Structures
            2.5.1.1        6.1.1 Sequence
            2.5.1.2        6.1.2 Parallel
            2.5.1.3        6.1.3 Choice
        2.5.2    6.2 Interacting
            2.5.2.1        6.2.1 Interaction Based Information Alignment
            2.5.2.2        6.2.2 Interaction Life-line
            2.5.2.3        6.2.3 Interaction Syntax
        2.5.3    6.3 Composing Choreographies
        2.5.4    6.4 Assigning Variables
        2.5.5    6.5 Marking Silent Actions
        2.5.6    6.6 Marking the Absence of Actions
        2.5.7    6.7 Finalizing a Choreography
3 Example 4 Relationship7 Interoperability with other Specifications
    7.1 Interoperability with theSecurity framework 5 Relationshipframeworks
    7.2 Interoperability with theReliable Messaging framework 6 Relationshipframeworks
    7.3 Interoperability with theCoordination framework 7 Relationshipframeworks
    7.4 Interoperability with theAddressing frameworkframeworks
8 Conformance
    8.1 Conforming WS-CDL documents
    8.2 Endpoint conformance
9 Acknowledgments
10 References
11 Last Call Issues     11.1 Issue 1     11.2 Issue 2 12    10.1 Normative References
    10.2 Informative References

Appendices

A Mime Type definition
B WS-CDL XSD Schemas


1 Introduction

For many years, organizations have beingbeen 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 partyparticipant 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/2004/08/wsdlhttp://www.w3.org/2005/08/wsdl WSDL 2.0 namespace for WSDL framework.
cdl http://www.w3.org/2004/12/ws-chor/cdlhttp://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 samplesexamples only. In particular, URIs starting with "http://example.com""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:

  • The syntax appears as an XML instance, but the values indicate the data types instead of values.

  • Characters are appended to elements and attributes as follows: "?" (0 or 1), "*" (0 or more), "+" (1 or more).

  • Elements names ending in ". . ." (such as <element."<element. . ./>./>" or <element."<element. . .>).>") indicate that elements/attributes irrelevant to the context are being omitted.

  • Grammar in bold has not been introduced earlier in the document, or is of particular interest in an example.

  • <--"<-- extensibility element -->-->" is a placeholder for elements from some "other" namespace (like ##other in XSD).

  • The XML namespace prefixes (defined above) are used to indicate the namespace of the element being defined.

  • Examples starting with <?xml"<?xml" contain enough information to conform to this specification; other examples are fragments and require additional information to be specified in order to conform.

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 the Choreography Description LanguageWS-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 partiesparticipants 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 partiesparticipants and responsibilities of each, is missing.

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

Using the Web Services ChoreographyWS-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 partiesparticipants involved. Each partyparticipant 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 anyoneany 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 Choreographychoreography as determined by the common or global view. It is the intent of CDLWS-CDL that the conformance of each implementation to the common view expressed in CDLtherein is easy to determine.

The figure below demonstrates a possible usage of the Choreography Description Language. Figure 1: Integrating Web Services based applications using WS-CDLWS-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 Choreography Description LanguageWS-CDL based representation. In this example, a Choreographychoreography specifies the interactions between services across business entities ensuring interoperability, while leaving actual implementation decisions in the hands of each individual company:

  • Company "A" relies on a WS-BPEL [WSBPEL] solution to implement its own part of the Choreographychoreography

  • Company "B", having greater legacy driven integration needs, relies on a J2EE [J2EE] solution incorporating Java and Enterprise Java Bean Components or a .NET [C#S] solution incorporating C# to implement its own part of the Choreographychoreography

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

1.3 Goals

The primary goal of a Choreography Description Languagethe 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 Choreography Description LanguageWS-CDL specification are to permit:

  • Reusability. The same Choreographychoreography definition is usable by different partiesparticipants operating in different contexts (industry, locale, etc.) with different software (e.g. application software)

  • Cooperation. Choreographies define the sequence of exchanging messages between two (or more) independent partiesparticipants or processes by describing how they should cooperate

  • Multi-Party Collaboration. Choreographies can be defined involving any number of partiesparticipants or processes

  • Semantics. Choreographies can include human-readable documentation and semantics for all the components in the Choreographychoreography

  • Composability. Existing Choreographieschoreographies can be combined to form new Choreographieschoreographies that may be reused in different contexts

  • Modularity. Choreographies can be defined using an "inclusion" facility that allows a Choreographychoreography to be created from parts contained in several different Choreographieschoreographies

  • Information Driven Collaboration. Choreographies describe how partiesparticipants make progress within a collaboration, through the recording of exchanged information and changes to observable information that cause ordering constraints to be fulfilled and progress to be made

  • Information Alignment. Choreographies allow the partiesparticipants that take part in Choreographieschoreographies to communicate and synchronize their observable information

  • Exception Handling. Choreographies can define how exceptional or unusual conditions that occur while the Choreographychoreography is performed are handled

  • Transactionality. The processes or partiesparticipants that take part in a Choreographychoreography can work in a "transactional" way with the ability to coordinate the outcome of the long-lived collaborations, which include multiple participants, each with their own, non-observable business rules and goals

  • Specification Composability. This specification willis intended to work alongside andand/or complement other specifications such as the WS-Reliability [WSRM], WS-Composite Application Framework (WS-CAF) [WSCAF], WS-Security [WSS], Business Process Execution Language for WS (WS-BPEL) [WSBPEL], ebXML Business Process Specification Schema [ebBP20], [BPSS11], etc.

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 XPointerXPath 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 [Action: add references][BP11] is a normative part of the WS-CDL specification.

1.5 Relationship with Business Process Languages

A Choreography Description LanguageWS-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.

A Choreography Description LanguageWS-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 partyparticipant regardless of the supporting platform or programming model used by the implementation of the hosting environment. Each party, adhering to a Choreography Description Language collaboration representation, could be implementedWS-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:

  • Applications, whose implementation is based on executable business process languages [XLANG], [WSFL], [WSBPEL], [BPML], [XPDL]

  • Applications, whose implementation is based on general purpose programming languages [JLS], [C#S]

  • Or human controlled software agents

1.6 Time Assumptions

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

2 Choreography Description Language Model This section introduces1.7 Authoritative Schema

In the Web Services Choreography Description Language (WS-CDL) model. 2.1event 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 parties.participants. In order to facilitate these collaborations, services commit to mutual responsibilities by establishing Relationships.formal relationships. Their collaboration takes place in a jointly agreed set of ordering and constraint rules, whereby information is exchanged between the parties.participants.

The WS-CDL model consists of the following entities:

2.23 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 Choreographychoreography type definitions inside.

2.2.13.1 Choreography Package

A Choreography Packagechoreography 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.choreography packages.

The syntax of the package construct is:

<package  
    name="ncname"name="NCName" 
   author="xsd:string"?
   version="xsd:string"?
   targetNamespace="uri"
    xmlns="http://www.w3.org/2004/12/ws-chor/cdl"> informationType* token* tokenLocator* roleType* relationshipType* participantType* channelType*xmlns="http://www.w3.org/2005/10/cdl">

   <informationType/>*
   <token/>*
   <tokenLocator/>*
   <roleType/>*
   <relationshipType/>*
   <participantType/>*
   <channelType/>*

   Choreography-Notation*
</package>

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

  • Zero or more Information TypesinformationTypes

  • Zero or more Tokenstokens and Token Locatorstoken locators

  • Zero or more Role TypesroleTypes

  • Zero or more Relationship TypesrelationshipTypes

  • Zero or more Participant TypesparticipantTypes

  • Zero or more Channel TypeschannelTypes

  • Zero or more Package-level Choreographiespackage-level choreographies

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

The targetNamespace attribute provides the namespace associated with all WS-CDL type definitions contained in this Choreography Package.choreography package. WS-CDL type definitions included in this Package,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 Choreographieschoreographies defined within this Choreography Package. 2.2.2choreography 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 SHOULDshould be done carefully in order to avoid duplicate definitions (Variables,(variables, blocks, etc.). A WS-CDL processor MUST ensure that the document is correct before processing it. The correctness may involve XML well-formedness as well as semantic ;checks, such as unicity of Variable definitions, ofa single root Choreography, etc.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 ChoreographyWS-CDL type definitions.

<choreography name="newChoreography" root="true">
...
   <variable name="newVariable" informationType="someType"
              role="randomRome"/>roleType="randomRoleType"/>
   <xi:include  href="genericVariableDefinitions.xml" />href="genericVariableDefinitions.xml"/>
   <xi:include href="otherChoreography.xml"
                xpointer="xpointer(//choreography/variable[1]) />xpointer="xpointer(//choreography/variable[1])"/>
... 
</choreography>

2.2.33.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 isMUST be made using a QName."QName".

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

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

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

2.2.43.4 Language Extensibility

and BindingTo support extending the WS-CDL language, this specification allows the use of extensibility elements and/or attributes defined in other XML namespaces.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 changecontradict the semantics of any element or attribute from the WS-CDL namespace.

2.2.53.5 Semantics

Within a WS-CDL document, descriptions allow the recording ofmay 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 allow forreference the recording of semanticsdescriptions in any or all of the following ways:areas:

  • Text. This will be in plain text or possiblyPlain text, HTML and should be briefor other non-encoded text formats may apply (e.g. text/plain, text/html, text/sgml, text/xml, etc.).

  • Document Reference. This willMAY contain a URI to a document that more fully describes the componentcomponent.

  • Machine Oriented Semantic Descriptions. This willMAY contain machine processable definitions in languages such as RDF [RDF] or OWL Descriptions that are text[OWL]. This description MAY contain a URI.

The semantics of any element or document references canattribute from the WS-CDL namespace SHOULD remain unchanged and MUST NOT be defined in multiple different human readable languages. 2.3contradicted.

4 Collaborating PartiesParticipants

The WSDL specification [WSDL20] describes the functionality of a service provided by a partyparticipant 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 partyparticipant represents a requester of services provided by another partyparticipant and is at the same time a provider of services requested from other parties,participants, thus creating mutual multi-partymulti-participant service dependencies.

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

The Role TypesroleTypes, Participant TypesrelationshipTypes , participantTypes, Relationship Typesand Channel TypeschannelTypes define the coupling of thecollaborating parties. 2.3.1 Role Types A Role Type enumerates the observable behaviorparticipants 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 party exhibitsparticipant can exhibit in order to collaborate with other parties.interact. For exampleexample, the "Buyer" Role TyperoleType is associated with the purchasing of goods or services and the "Supplier" Role TyperoleType is associated with providing those goods or services for a fee.

The syntax of the roleType construct is:

<roleType  name="ncname">name="NCName">
   <behavior  name="ncname" interface="qname"?name="NCName" interface="QName"? />+
</roleType>

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

Within the roleType element, thea behavior element specifies a subset of the observable behavior a partyparticipant exhibits. A Role TyperoleType MUST contain one or more behavior elements. The attribute name within the behavior element is used for specifyingto 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 Role TyperoleType that is not required to support a specific Web Service interface.

2.3.2 Relationship Types4.2 RelationshipType

A Relationship TyperelationshipType identifies the Role TypesroleTypes and Behaviors,behaviors, where mutual commitments between two partiesMUST be made for themcollaborations to collaborate successfully.be successful. For exampleexample, the Relationship TypesrelationshipTypes between a Buyer"Buyer" and a Seller"Seller" could include:

  • A "Purchasing" Relationship Type,relationshipType, for the initial procurement of goods or services, and

  • A "Customer Management" Relationship TyperelationshipType to allow the Supplier"Supplier" to provide service and support after the goods have been purchased or the service provided

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

  • A "Logistics Provider" Relationship TyperelationshipType between the Supplier"Supplier" and the Shipper,"Shipper", and

  • A "Goods Delivery" Relationship TyperelationshipType between the Buyer"Buyer" and the Shipper"Shipper"

The syntax of the relationshipType construct is:

<relationshipType  name="ncname"> <role type="qname"name="NCName">
   <roleType typeRef="QName" behavior="list of  ncname"?NCName"? />
    <role type="qname"<roleType typeRef="QName" behavior="list of  ncname"?NCName"? />
</relationshipType>

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

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

Within each roleroleType element, the OPTIONAL attribute behavior identifies the commitment of a partyparticipant as an XML-Schema list of behavior types belonging to this Role Type.roleType. If the behavior attribute is missing then all the behaviors belonging to this Role TyperoleType are identified as the commitment of a party. 2.3.3 Participant Types A Participant Type identifies a set of Role Types that MUST be implemented byparticipant. If the same logical entity or organization. Its purposebehavior attribute is present then the behaviors listed MUST be a proper subset of those belonging to groupthis roleType.

4.3 ParticipantType

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

The syntax of the participantType construct is:

<participantType  name="ncname"> <role type="qname"name="NCName">
   <roleType typeRef="QName" />+
</participantType>

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

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

An example is givenshown below where the "SellerForBuyer" Role TyperoleType belonging to a "Buyer-Seller" Relationship TyperelationshipType is implemented by the Participant TypeparticipantType "Broker" which also implements the "SellerForShipper" Role TyperoleType belonging to a "Seller-Shipper" Relationship Type:relationshipType.

<roleType name="Buyer">
   . . .
</roleType>
<roleType name="SellerForBuyer">
    <behavior name="sellerForBuyer" interface="rns:sellerForBuyerPT"/>
</roleType>
<roleType name="SellerForShipper">
    <behavior name="sellerForShipper" interface="rns:sellerForShipperPT"/>
</roleType>
<roleType name="Shipper">
   . . .
</roleType>

<relationshipType name="Buyer-Seller">
     <role type="tns:Buyer"<roleType typeRef="tns:Buyer" />
     <role type="tns:SellerForBuyer"<roleType typeRef="tns:SellerForBuyer" />
</relationshipType>
<relationshipType name="Seller-Shipper">
     <role type="tns:SellerForShipper"<roleType typeRef="tns:SellerForShipper" />
     <role type="tns:Shipper"<roleType typeRef="tns:Shipper" />
</relationshipType>

<participantType name="Broker">
    <role type="tns:SellerForBuyer"<roleType typeRef="tns:SellerForBuyer" />
    <role type="tns:SellerForShipper"<roleType typeRef="tns:SellerForShipper" />
</participantType>

2.3.4 Channel Types4.4 ChannelType

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

A Channel TypechannelType MUST describe the Role TyperoleType and the referencetype of a party,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 thenused for determining where and how to send or receive information to or intofrom the party.participant.

A Channel TypechannelType MAY specify the instance identity of an entity implementingdescribe the behavior(s)type of a party, beingthe targetinstance identity of an information exchange. A Channel Type MAY describeone or more logical conversations between parties,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 Channel(s)channelType instances MAY be passed around from one partyparticipant to another in an information exchange. A Channel TypechannelType MAY be used to:

  • Restrict the number of times a Channelan instance of this Channel TypechannelType can be used

  • Restrict the type of information exchange that can be performed when using a Channelan instance of this Channel TypechannelType

  • Restrict the Channel Type(s)channelTypes that will be passed through a Channelan instance of this Channel TypechannelType

  • Enforce that a passed Channelchannel instance is always distinctunique

The syntax of the channelType construct is:

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

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

    <role type="qname" behavior="ncname"?<roleType typeRef="QName"  behavior="NCName"? />

   <reference>
      <token  name="qname"/>name="QName"/>
   </reference>

    <identity><identity usage="primary"|"alternate"|"derived"|"association">
      <token  name="qname"/>+ </identity>?name="QName"/>+
   <identity>*
</channelType>

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

The OPTIONAL attribute usage is used to restrictconstrain the number of times a Channelway in which an instance of this Channel TypechannelType, can be used. The OPTIONAL attribute action is used to restrict the type of information exchangevalues that can be performed when usingused for this attribute are:

  1. "once" - Once means that a Channelchannel instance of this Channel Type. The type of information exchange performed could eitherchannelType can be a request-respond exchange, a request exchange,used for one interaction, or can be passed to another roleType. When a respond exchange. The default forchannel instance of this attributechannelType is set to "request". The OPTIONAL element passing describespassed, the Channel Type(s)passer of the Channel(s)channel instance MUST relinquish control, for outputting only, of that are passed, from one partyinstance and passes control to another, when using an information exchange on a Channelthe receiver. A channel instance of this Channel Type. The OPTIONAL attribute action within the passing element defines ifchannelType MUST NOT be passed to more than one receiver at any one time.

  2. "distinct" (default usage mode) - Distinct means that a Channel willchannel 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 set to"request". The OPTIONAL attribute new within the passing elementelement, when set to "true""true", enforces a passed Channelchannel instance to be always distinct.unique. If the element passing is missingmissing, then this Channel TypechannelType MAY be used for exchanging informationinformation, but MUST NOT be used for passing Channelschannel instances of any Channel Type.channelType.

The element roleroleType is used to identify the Role TyperoleType of a party,participant, being the targettype of the target of an information exchange, which is then used for statically determining where and how to send or receive information to or intofrom the participant. Each roleType is specified by the party.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 used for describingthe 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 party,participant reference, conveying the information needed to address the participant being the target of an information exchange, which is thenused for dynamically determining where and how to send or receive information to or intofrom the party.participant. The referencetype of a partyparticipant reference is distinguished by a Tokentoken, as specified by the name attribute of the token element within the reference element.

The OPTIONAL elementlist of identity elements MAY be used to associate a unique identity for identifying aneach instance of an entity implementingthe behavior of a party and for identifying a logical conversation between parties.channelType. The identity and the different conversations are distinguishedis defined by a set of Tokens astokens specified by the name attribute of the token element within the identity element. The following rule applies for Channel Type:If two or more Channel Types SHOULD point to Role Types that MUST be implemented by the same logical entity or organization, then the specified Role Types MUST belong to the same Participant Type. In addition, theidentity elements are specified within the Channel Types MUSTsame or different channelType elements, and they have the same numberset of Tokens withnamed tokens in the same informationTypes specified inorder, then they are considered to represent the same orderidentity type.

The example below showsidentity element has a mandatory usage attribute, which defines the definitionpurpose of the Channel Type "RetailerChannel" that realizes a pointidentity in the context of collaboration with a Retailer.the channelType. The Channel Type identifiesvalues for this attribute are:

  1. "primary" - The 'primary' usage classification means that the Role Type ofidentity is created by the Retailer asinitial 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.

    <channelType name="OrderChannel">
      …
      <identity usage="primary">
        <token name="OrderId" />
      </identity>
    </channelType>
    

    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.

    <channelType name="OrderChannel">
      …
      <identity usage="primary">
        <token name="OrderId" /> 
      </identity> 
      <identity usage="alternate"> 
        <token name="TxnId" />
      </identity>
    </channelType>
    

    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.

    <channelType name="OrderChannel">
      …
      <identity usage="primary">
        <token name="OrderId" />
      </identity>
      <identity usage="derived">
        <token name="DeliveryId" />
      </identity>
    </channelType>
    
    <channelType name="DeliveryChannel">
      …
      <identity usage="primary">
        <token name="DeliveryId" />
      </identity>
    </channelType>
    

    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 "Retailer".'derived' classification. The information for locating the Retailer is specifiedinitial message in the reference element, whereas thechannel instance of a process implementingMUST contain the Retailer is identifiedinformation to resolve this identity field.

    An example for correlation purposesusing the identity element. The element passing allows only a Channel of "ConsumerChannel" Type to be passed in a request information exchange through a Channel of "RetailerChannel" Type.this attribute is shown below.

    <channelType  name="RetailerChannel"> <passing channel="ConsumerChannel" action="request"name="OrderChannel">
      …
      <identity usage="primary">
        <token name="OrderId" />
       <role type="tns:Retailer" behavior="retailerForConsumer"/> <reference></identity>
    </channelType>
    
    <channelType name="SupplierChannel">
      …
      <identity usage="association">
        <token  name="tns:retailerRef"/> </reference> <identity>name="OrderId" />
      </identity>
    
      <identity usage="primary">
        <token  name="tns:purchaseOrderID"/>name="SupplierName" />
        <token name="OrderId" />
      </identity>
    </channelType>
    

    2.4This 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

PartiesParticipants 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 Choreographychoreography that can influence the observable behavior of the collaborating parties.participants.

Variables capture information about objects in the Choreography,choreography, such as the information exchanged or the observable information of the RolesroleTypes involved. Tokens are aliases that can be used to reference parts of a Variable.variable. Both Variablesvariables and Tokenstokens have Information TypesinformationTypes that define the type of information the Variablevariable contains or the Tokentoken references.

2.4.1 Information Types Information Types5.1 InformationType

InformationTypes describe the type of information used within a Choreography.choreography. By introducing this abstraction, a Choreographychoreography definition avoids referencingdirectly 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"? exceptionType="true"|"false"?name="NCName"
                 type="QName"?|element="QName"? />

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

The OPTIONAL attributes type and element describe the type of information used within a Choreographychoreography 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 of information is exclusively one of the aforementioned. When the OPTIONAL attribute exceptionType is set to "true", this Information Type is an Exception Typeand MAY map to a WSDL fault type. When the attribute exceptionType is set to "false", this information type MUST NOT map to a WSDL fault type. The default for this attribute is set to "false". In case of WSDL 2.0, the attributeelement within the informationType refers to a unique WSDL 2.0 faultname when the attribute exceptionType is set to "true".MUST be mutually exclusive.

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

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

   <informationType name="purchaseOrder" type="pns:purchaseOrderMessage"/>

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

   <informationType name="customerAddress" element="cns:CustomerAddress"/>

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

   <informationType name="intType" type="xsd:int"/>

Example 4: The informationType "OutOfStockExceptionType" is of type Exception Type and refers to the WSDL 2.0 fault name "cwns:OutOfStockExceptionType" <informationType name="OutOfStockExceptionType" type="cwns:OutOfStockExceptionType" exceptionType="true"/> 2.4.25.2 Variables

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

  • Information Exchange Capturing Variables , whichexchange capturing variables contain informationinformation, such as an "Order""Order", that is:are:

    • Used to populate the content of a message to be sent, before or at the occurrence of message-has-been-sent-event or
    • Populated as a result of a message receivedmessage-received-event occurrence
  • State Capturing Variables , whichcapturing variables contain information about the observable changes at a RoleroleType as a result of information being exchanged. For exampleexample, when a Buyer"Buyer" sends an "Order" to a Seller,"Seller", the Buyer"Buyer" could have a Variablevariable called "OrderState" set to a value of "OrderSent"'OrderSent' and once the message was"Seller" received bythe Seller,message, the Seller"Seller" could have a Variablevariable called "OrderState" set to a value of "OrderReceived". Note that the Variable'OrderReceived'. The "OrderState" at the Buyer"Buyer" is a different Variable tonot the same variable as the "OrderState" at the Seller Channel Capturing Variables . For example, a"Seller"

  • Channel Variable couldcapturing variables contain information such as;as: the URL"URL" to which the message could be sent, the policies that are to be applied (e.g. security), whether or not reliable messaging is to be used, etc. How and where such information is expressed is outside the scope of this specification

  • Exception capturing variables contain information about a caused exception

The value of Variables: Area variable:

  • Is available to RolesroleTypes within a Choreography,choreography, as specified in the variable Definition, and when the Variables containvariable contains information that is common knowledge. For exampleexample, the Variablevariable "OrderResponseTime" which isspecifies the time in hours in which a response to an Order"Create Order" request must be sent is initialized prior to the initiation of a Choreographychoreography and can be used by all RolesroleTypes within the Choreographychoreography, if the variable is defined for all roleTypes

  • Can be made available as a result of an Interaction Information Exchange Capturing Variables areinteraction

    • An information exchange capturing variable is populated and becomebecomes available at the Rolesspecified roleTypes at the ends of an Interactioninteraction
    • State Capturing Variables,capturing variables, that contain information about the observable information changes of a RoleroleType as a result of information being exchanged, are recordedexchanged and recorded, which become available at the ends of an interaction
  • Can be created or changed and made available locally at a RoleroleType by assigning data from other information. TheyIt can be Information Exchange, Statean information exchange, state or Channel Capturing Variables.channel capturing variable. For exampleexample, "Maximum Order Amount" could be data created by a Seller"Seller" that is used together with an actual order amount"Order amount" from an Ordera "Create Order" request received at the "Seller" to control the ordering of the Choreography.choreography. In this case how "Maximum Order Amount" is calculated and its value would not be known by the other RolesroleTypes

  • Can be used to determine the decisions and actions to be taken within a Choreography Can be used to cause Exceptions at one or more parties in a Choreography Definedchoreography

  • That is defined at different RolesroleTypes that are part of the same ParticipantparticipantType is shared between these RolesroleTypes when the Variablesvariables have the same name

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 Variablesvariables within a Choreography.choreography.

The syntax of the variableDefinitions construct is:

<variableDefinitions>
   <variable    name="ncname" informationType="qname"?|channelType="qname"?name="NCName"
       informationType="QName"?|channelType="QName"?
       mutable="true|false"?
       free="true|false"?
       silent="true|false"?
       roleTypes="list of  qname"?QName"? />+
</variableDefinitions>

A Variablevariable defined using the attribute informationType specifies either Information Exchange Capturing Variables or State Capturing Variables. A Variable defined using the attribute informationType specifies Exception Capturing Variables when the referencedinformation type has the attribute exceptionType set to "true".exchange capturing variables or state capturing variables. A Variablevariable defined using the attribute channelType specifies Channel Capturing Variables.channel capturing variables. The attributes informationType and channelType areMUST be mutually exclusive.

The OPTIONAL attribute mutable , when set to "false", specifies that the Variablevariable information cannotMUST 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 Variablevariable in the Choreography.choreography. A silent Variablevariable is used to represent the result of actions within a partyparticipant 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,free , when set to "true" specifies that a Variablevariable defined in an enclosing Choreographychoreography is also used in this Choreography,choreography, thus sharing the Variablesvariable's information. The following rules apply in this case:

  • The type (as specified by the informationType or the channelType attributes) of a free Variablevariable MUST match the type of the Variablevariable defined in an enclosing Choreographychoreography

  • The attributes silent and mutable of a free Variablevariable MUST match the attributes silent and mutable of the Variablevariable defined in an enclosing Choreographychoreography

  • A perform activity MUST bind a free Variablevariable defined in ana performed Choreographychoreography with a Variablevariable defined in a performing Choreographychoreography

The OPTIONAL attribute free , when set to "false" specifies that a Variablethe variable is defined in this Choreography.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 Role Type(s)roleTypes of a partyparticipant at which the Variablevariable information will reside. A Variablevariable defined without a Role TyperoleType is equivalent to a Variablevariable that is defined at all the Role TypesroleTypes that are part of the Relationship TypesrelationshipTypes of the Choreographychoreography where the Variablevariable is defined. For exampleexample, if Choreography "C1"choreography "choreo1" has Relationship Type "R"relationshipType "rel" that has Roles "Role1", "Role2",roleTypes "roleType1" and "roleType2", then a Variablevariable "var" defined in Choreography "C1"choreography "choreo1" without a roleTypes attribute means it is defined at both "Role1""roleType1" and "Role2"."roleType2".

The attribute name is used for specifyingto specify a distinct name for each Variablevariable declared within the variableDefinitions element. In those cases where the visibility of a Variablevariable is wholly within a single RoleroleType, then that RoleroleType needs to be named in the definition of the Variablevariable as the Role TyperoleType using the attribute roleTypes . In those cases where the Variablevariable is shared amongst a subset of RolesroleTypes within a Choreographychoreography, those RolesroleTypes need to be listed within the definition of the Variablevariable as the Role TypesroleTypes using the attribute roleTypes .

2.4.35.3 Expressions

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

Generic expressions and literals can be used for populating a Variable.to populate variables. Predicate expressions can be used within WS-CDL to specify conditions. Query expressions are used within WS-CDL to specify query strings.queries.

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

WS-CDL defines a set of XPath function extensions as described in the following section.1.0 extension functions that implementers MUST support. The function extensionsfunctions are defined in the standard WS-CDL namespace "http://www.w3.org/2004/12/ws-chor/cdl".http://www.w3.org/2005/10/cdl. The prefix "cdl:" is associated with this namespace.

2.4.3.15.3.1 WS-CDL Supplied Functions

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

  • xsd:time getCurrentTime(xsd:QName roleName)roleTypeName?) Returns the current time at the caller. The caller for the Roleis specified by roleName (for examplethe roleTypeName parameter (i.e. a RoleroleType can ask only about it,sit's own time). The roleTypeName parameter is OPTIONAL. When this parameter is used, the current time information MUST be available at the roleType specified by roleTypeName. If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:date getCurrentDate(xsd:QName roleName)roleTypeName?) Returns the current date at the caller. The caller for the Roleis specified by roleName (for examplethe roleTypeName parameter (i.e. a RoleroleType can ask only about it,sits own date). The roleTypeName parameter is OPTIONAL. When this parameter is used, the current date information MUST be available at the roleType specified by roleTypeName. If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:dateTime getCurrentDateTime(xsd:QName roleName)roleTypeName?) Returns the current date and time at the caller. The caller for the Roleis specified by roleName (for examplethe roleTypeName parameter (i.e. a RoleroleType can ask only about it,sits own date/time). xsd:booleanThe roleTypeName parameter is OPTIONAL. When this parameter is used, the current date and time information MUST be available at the roleType specified by roleTypeName. If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:Boolean hasDurationPassed(xsd:duration elapsedTime, xsd:QName roleName)roleTypeName?) Returns "true" if,if (a) used in a guard or repetition condition of a Work Unitworkunit with the block attribute set to "true" or in a complete condition of a Choreographychoreography and (b) the duration specified by elapsedTime at the caller for the Rolecaller, specified by roleNameroleTypeName parameter, has elapsed from the time either the guard or the repetition condition were enabled for matching or the Choreographychoreography was enabled. Otherwise it returns "false". xsd:booleanThe roleTypeName parameter is OPTIONAL. If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:Boolean hasDeadlinePassed(xsd:dateTime deadlineTime, xsd:QName roleName)roleTypeName?) Returns "true" if,if (a) used in a guard or repetition condition of a Work Unitworkunit with the block attribute set to "true" or in a complete condition of a Choreographychoreography and (b) the time specified by deadlineTime at the RoleroleType, specified by roleNamethe roleTypeName parameter, has elapsed given that either the guard or the repetition condition werewas enabled for matching or the Choreographychoreography was enabled. Otherwise it returns "false". xsd:string createNewID() Returns a new globally unique value of XML-Schema 'string' type.The roleTypeName parameter is OPTIONAL. If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:any getVariable(xsd:string varName, xsd:string part, xsd:string documentPath, xsd:QName roleName?)roleTypeName?) Returns the information of the Variablevariable with name varName as a node set containing a single node. The second parameter, part , specifies the message part of a WSDL1.1 document. For a WSDL 2.0 document it MUST be empty. When the third parameter documentPath is empty, then this function retrieves the entire document from the Variablevariable information. When it is non-empty, then this function retrieves from the Variablevariable information, the fragment of the document at the provided absolute location path. The fourth parameter is OPTIONAL. When the fourth parameter is used, the Variablevariable information MUST be available at the RoleroleType specified by roleNameroleTypeName . If this parameter is not used then the RoleroleType is inferred from the context that this function is used.

  • xsd:booleanxsd:Boolean isVariableAvailable(xsd:string varName, xsd:QName roleName)roleTypeName?) Returns "true" if the information of the Variablevariable with name varName is available at the RoleroleType specified by roleNameroleTypeName . Returns "false" otherwise.Otherwise, returns "false". The roleTypeName parameter is OPTIONAL. When this parameter is used, the variable information MUST be available at the roleType specified by roleTypeName . If this parameter is not used then the roleType is inferred from the context that this function is used.

  • xsd:boolean variablesAligned(xsd:string varName, xsd:string withVarName, xsd:QName relationshipName)relationshipTypeName) Returns "true" if within a RelationshiprelationshipType specified by relationshipNamerelationshipTypeName the Variablevariable with name varName residing at the first RoleroleType of the RelationshiprelationshipType has aligned its information with the Variablevariable named withVarName residing at the second RoleroleType of the Relationship.relationshipType.

  • xsd:any getChannelReference(xsd:string varName) Returns the reference information of the Variablevariable with name varName. The Variablevariable MUST be of Channel Type.channelType.

  • xsd:any getChannelIdentity(xsd:string varName) Returns the identity information of the Variablevariable with name varName. The variable MUST be of channelType.

  • xsd:Boolean globalizedTrigger(xsd:string expression1, xsd:string roleTypeName1, xsd:string expression2, xsd:string roleTypeName2, . . .) Combines expressions that are defined at different roleTypes. Thus expression1 is defined in terms of variables at role1, expression2 is defined in terms of variables at role2, and so on. The globalizedTrigger function is evaluated at each roleType and becomes "true" at a roleType if, and only if, the expression evaluated at that roleType evaluates to "true".

  • xsd:boolean hasExceptionOccurred(xsd:QName exceptionType) Returns "true" if an exception of the type identified by the parameter exceptionType has occurred. Otherwise it returns "false".

  • xsd:boolean hasChoreographyCompleted(xsd:string choreoName, xsd:string choreoInstanceId?) Returns true if the performed choreography associated with the parameter 'choreoName' and OPTIONAL choreoInstanceId has a status of completed (whether successfully or not). If choreoInstanceId is not specified, the function will evaluate whether all performed choreographies, with the supplied name, have completed. If the named choreography has not been performed, prior to this function being called, it will return false.

  • xsd:string getChoreographyStatus(xsd:string choreoName, xsd:string choreoInstanceId?) Returns the current status associated with name varNamethe identified choreography and OPTIONAL choreoInstanceId . The VariableIf choreoInstanceId is not specified, then there MUST only be a single instance of Channel Type. xsd:boolean globalizedTrigger(xsd:string expression, xsd:string roleName, xsd:string expression2, xsd:string roleName2, . . .) Combines expressionsthat include Variablesperformed choreography in the scope of the current choreography that are defined at different Roles. Only one expressionis checking the status, otherwise a status of 'ambiguous' MUST be defined per Role name. xsd:boolean cdl:hasExceptionOccurred(xsd:string exceptionType) Returns "true" if an Exceptionreturned. The values of Exception Type identified bythe parameter exceptionTypestatus can be 'enabled', 'completed-successfully', 'completed-unsuccessfully', 'closed', 'ambiguous', or 'instance-unknown'. The 'instance-unknown' status is encountered when this function is invoked and when the choreography has occurred. Otherwise it returns "false". 2.4.4 Tokens Anot been enabled. The other valid transitions of the choreography status are outlined in Section 5.7, Choreography Life-line.

5.4 Token and TokenLocator

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

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

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

The syntax of the token construct is:

<token   name="ncname" informationType="qname"name="NCName"  informationType="QName" />

The attribute name is used for specifyingto specify a distinct name for each token element declared within a Choreography Package.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"?tokenName="QName" 
               informationType="QName" 
               part="NCName"?
               query="XPath-expression" />

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

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

The OPTIONAL attribute part defines the document part on which the query is performed to locate the Token.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 Tokentoken "purchaseOrderID" is of XML-Schema type 'int'. The two Token Locatorstoken locators show how to access this Tokentoken in the "purchaseOrder" and "purchaseOrderAck" messages.

<token name="purchaseOrderID" informationType="xsd:int"/>

<tokenLocator tokenName="tns:purchaseOrderID" informationType="purchaseOrder"       
                query="/PO/OrderId"/>
<tokenLocator tokenName="tns:purchaseOrderID" informationType="purchaseOrderAck" 
                query="/POAck/OrderId"/>

2.4.5 Choreographies A5.5 Choreography

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

A Choreographychoreography defined at the Choreography Packagechoreography package level is called a top-level Choreographychoreography, and does not share its context with other top-level Choreographies.choreographies. A Choreography Package MAYchoreography package MUST contain exactlyzero or one top-level Choreography,choreography, marked explicitly as the root Choreography. The root Choreography is the only top-level Choreography that is enabled by default.choreography.

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

  • Locallylocally - its definition is contained within the enclosing Choreography Globallychoreography

  • globally - a separate top-level, non-root Choreographychoreography definition is specified in the same or in a different Choreography Packagechoreography package that can be used by other Choreographieschoreographies and hence the contract described becomes reusable

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

A Choreographychoreography MUST contain at least one Relationship Type,relationshipType, enumerating the observable behavior this Choreographychoreography requires its partiesparticipants to exhibit. One or more Relationship TypesrelationshipTypes MAY be defined within a Choreography,choreography, modeling multi-partymulti-participant collaborations.

A Choreographychoreography acts as a lexical name scoping context for Variables.variables. A Variablevariable defined in a Choreographychoreography is visible for use in this Choreographychoreography and all its enclosed Choreographies up-tochoreographies up to the point that the Variablevariable is re-definedredefined as ana non-free Variable,variable, thus forming a Choreography Visibility Horizonchoreography visibility horizon for this Variable.variable.

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

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

A Choreography can recover from exceptional conditions by defining one Exception Block , whichchoreography MAY be defined as part of the Choreographydefine an exceptionBlock to recover from exceptionalunusual conditions that can occur.

An enclosed Choreographychoreography 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 Finalizer Block(s)finalizerBlocks MAY be defined for an enclosed Choreography.choreography.

A Choreographychoreography can also be coordinated. Choreography Coordinationcoordination guarantees that all involved RolesroleTypes agree on how the Choreographychoreography ended. That is, if the Choreographychoreography completed successfully or suffered an Exception,exception, and if the Choreographychoreography completed successfully and Finalizer Block(s)finalizerBlocks were installed, all RolesroleTypes have the same Finalizer BlockfinalizerBlock enabled.

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

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

   <relationship   type="qname"type="QName" />+

   variableDefinitions?

   Choreography-Notation*

      Activity-Notation 

   <exceptionBlock   name="ncname">name="NCName">
      WorkUnit-Notation+
   </exceptionBlock>?

   <finalizerBlock   name="ncname"> WorkUnit-Notationname="NCName">
      Activity-Notation
   </finalizerBlock>*
</choreography>

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

The OPTIONAL complete attribute allowsmakes it possible to explicitly complete a Choreographychoreography as described below in the Choreography Life-linechoreography 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 Variablevariable defined in an enclosing Choreography,choreography, and changed within an enclosed Choreographychoreography, is available to its sibling Choreographies.choreographies. The default value for this attribute is set to"false". The following rules apply:

  • When isolation is set to "false", the Variablevariable information MAY be immediately overwritten by actions in its sibling Choreographieschoreographies.

  • When isolation is set to "true", changes to the Variablevariable information MUST be visible for read or for write to its sibling Choreographieschoreographies only after this Choreographychoreography has completedcompleted.

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 Coordinationchoreography coordination is required. The default value for this attribute is set to"false". The following rules apply:

  • When the coordination attribute is set to "true", Choreography Coordinationchoreography coordination is required and a Coordinationcoordination protocol MUST ensure that all the RolesroleTypes agree on how the Choreography endedchoreography ended.

  • When the coordination attribute is set to "false", the Choreographychoreography is not bound to a Coordination protocol, and sincecoordination protocol. Since none of the above guarantees of agreement on the outcome applyapply, any required coordination SHOULD be performed using explicitly modeled Interactionsinteractions.

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

The OPTIONAL variableDefinitions element enumerates the Variablesvariables defined in this Choreography.choreography.

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

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

The OPTIONAL exceptionBlock element defines the Exception BlockexceptionBlock of a Choreographychoreography by specifying one or more Exception Work Unit(s)exception workunits using a WorkUnit-Notation. Within this element, the attribute name is used for specifyingto specify a name for this Exception BlockexceptionBlock element.

The OPTIONAL finalizerBlock element defines a Finalizer BlockfinalizerBlock for a Choreography.choreography. A Choreographychoreography MAY have more than one Finalizer Blocks.finalizerBlock. Each Finalizer BlockfinalizerBlock specifies one Finalizer Work Unitfinalizer activity using a WorkUnit-Notationan Activity-Notation. If a Choreographychoreography defines more than one Finalizer Blocks,finalizerBlock, then each MUST be differentiated by a distinct name as specified with the name attribute within the finalizerBlock element.

2.4.6 WorkUnits5.6 WorkUnit

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

  • A "Change Order" Work Unitworkunit that can be performed whenever an order acknowledgement message has been received and an order rejection has not been receivedreceived.

  • An "Order Delivery Error" Work Unitworkunit that is performed whenever the "Place Order" Work Unitworkunit did not reach a 'normal' conclusion. This would have a constraint that identifies the errorerror.

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

A Work Unit completesworkunit MUST complete successfully when all its enclosed actions complete successfully.

A Work Unitworkunit 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 Work Unitworkunit as follows:

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

      Activity-Notation 
</workunit>

The attribute name is used for specifyingto specify a name for each Work Unitworkunit element declared within a Choreography Package.choreography package.

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

The OPTIONAL attribute guard specifies the guard condition of a Work Unit.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 Work Unit.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 Work Unitworkunit has to block waiting for referenced Variablesvariables 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 Work Units.exception workunits. The default value for this attribute is set to"false".

TheAs detailed above, the following rules apply:

  • When a guard condition is not specified then the Work Unitworkunit always matches

  • One or more Work Unitsworkunits MAY be matched concurrently if their respective expressed interests are matched

  • When a repetition condition is not specified then the Work Unitworkunit is not considered again for matching after the Work Unitworkunit was matched once

  • One or more Variablesvariables can be specified in a guard condition or repetition condition, using XPATHXPath 1.0 and the WS-CDL functions, as described in Section 2.4.3.15.3.1

  • The WS-CDL function getVariable is used in the guard or repetition condition to obtain the informationvalue of a Variablevariable at the specific roleType (i.e. it can not be used to perform a remote value fetch)

  • When the WS-CDL function isVariableAvailable is used in the guard or repetition condition, it means that the Work Unitworkunit that specifies the guard or repetition condition is checking if a Variablevariable is already available at a specific RoleroleType or is waiting for a Variablevariable to become available at a specific Role,roleType, based on the block attribute being "false" or "true" respectively

  • When the WS-CDL function variablesAligned is used in the guard or repetition condition, it means that the Work Unitworkunit that specifies the guard or repetition condition is checking or waiting for an appropriate alignment Interactioninteraction to happen between the two Roles,roleTypes, based on the block attribute being "false" or "true" respectively. The Variablesvariables checked or waited for alignment are the sending and receiving ones in an alignment Interactioninteraction or the ones used in the recordings at the two RolesroleTypes at the ends of an alignment Interaction.interaction. When the variablesAligned WS-CDL function is used in a guard or repetition condition, then the Relationship TyperelationshipType within the variablesAligned MUST be the subset of the Relationship TyperelationshipType that the immediate enclosing Choreographychoreography defines

  • Variables defined at different RolesroleTypes MAY be used in a guard condition or repetition condition to form a globalized view, thus combining constraints prescribed for each RoleroleType but without requiring that all these constraints have to be fullfilledfulfilled for progress to be made. The globalizedTrigger WS-CDL function MUST be used in a guard condition or repetition condition in this case. Variables defined at the same RoleroleType MAY be combined together in a guard condition or repetition condition using all available XPATHXPath 1.0 operators and all the WS-CDL functions

  • If the attribute block is set to "true" and one or more required Variable(s)variables are not available or the guard condition evaluates to "false", then the Work Unitworkunit MUST block. When the required Variablevariable information specified by the guard condition become available and the guard condition evaluates to "true", then the Work Unitworkunit is matched. If the repetition condition is specified, then it is evaluated when the Work Unitworkunit completes successfully. Then, if the required Variablevariable information specified by the repetition condition is available and the repetition condition evaluates to "true", the Work Unitworkunit is considered again for matching. Otherwise, the Work Unitworkunit is not considered again for matching

  • If the attribute block is set to "false", then the guard condition or repetition condition assumes that the Variablevariable information is currently available. If either the Variablevariable information is not available or the guard condition evaluates to "false", then the Work Unitworkunit matching fails and the Activity-Notation enclosed within the Work Unitworkunit is skipped and the repetition condition is not evaluated even if specified. Otherwise, if the Work Unitworkunit matching succeeds, then the repetition condition, if specified, is evaluated when the Work Unitworkunit completes successfully. Then, if the required Variablevariable information specified by the repetition condition is available and the repetition condition evaluates to "true", the Work Unitworkunit is considered again for matching. Otherwise, the Work Unitworkunit is not considered again for matching

The examples below demonstrate some usages of a Work Unit:workunit:

a. Example of a Work Unitworkunit with block equals to "true":

In the following Work Unit,workunit, the guard condition waits on the availability of "POAcknowledgement" at "Customer" RoleroleType and if it is already available, the activity happens, otherwise, the activity waitsblocks until the Variablevariable "POAcknowledgement" becomebecomes available at the "Customer" Role.roleType.

<workunit  name="POProcess" 
            guard="cdl:isVariableAvailable( cdl:getVariable("POAcknowledgement"), "", "", "tns:Customer")"guard="cdl:isVariableAvailable('POAcknowledgement','','','tns:Customer')"
      block="true">
   ... <!--some activity -->
</workunit>

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

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

<workunit  name="StockCheck" 
     guard="cdl:getVariable("StockQuantity", "", "/Product/Qty", "tns:Retailer")guard="cdl:getVariable('StockQuantity','','/Product/Qty', 'tns:Retailer') > 10)"
    block="false" >
   ... <!--some activity -->
</workunit>

c. Example of a Work Unitworkunit waiting for alignment to happen:

In this example the following Work Unit, the guard conditionworkunit waits for an alignment Interaction to happen betweenuntil the "purchase order" information at the "Customer" Roleand the "Retailer" Role: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:

<roleType name="Customer">
   . . .
</roleType>
<roleType name="Retailer">
   . . .
</roleType>
<relationshipType name="Customer-Retailer-Relationship">
     <role type="tns:Customer"<roleType typeRef="tns:Customer" />
     <role type="tns:Retailer"<roleType typeRef="tns:Retailer" />
</relationshipType>

<workunit  name="WaitForAlignment" 
        guard="cdl:variablesAligned( "PurchaseOrderAtBuyer", "PurchaseOrderAtSeller", "tns:Customer-Retailer-Relationship")"guard="cdl:variablesAligned('
                    PurchaseOrderAtBuyer','PurchaseOrderAtSeller',
                    'tns:Customer-Retailer-Relationship')"
       block="true" >
   ... <!--some activity -->
</workunit>

2.4.75.7 Choreography Life-line

A Choreographychoreography life-line expresses the progression of a collaboration through enabled activities and enclosed Choreographies.choreographies. Initially, the collaboration is established between parties,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 Choreographychoreography is initiated, establishing a collaboration when an Interaction,interaction, explicitly marked as an Choreography Initiatorchoreography initiator, is performed. This causes the Exception BlockexceptionBlock to be installed and the Choreographychoreography enters the Enabled State . Before this point there is no observable association between any of the parties.participants.

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

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

A Choreographychoreography in an Enabled State, completes unsuccessfully,State MUST complete unsuccessfully when an Exceptionexception is caused in the Choreographychoreography and its Exception Block is enabled,exceptionBlock, if present.present, MUST be enabled. This causesMUST cause the Choreographychoreography to enter the Unsuccessfully Completed State.

The unsuccessfully completed Choreography, enterschoreography MUST enter the Closed State once the Exception Block,exceptionBlock, if present, is completed. If the Exception BlockexceptionBlock is not present, the Choreographychoreography implicitly enters the Closed State and the Exceptionexception occurred isMUST be propagated to the enclosing Choreography.choreography, if an enclosing choreography exists.

A Choreographychoreography in an Enabled State, completesState MUST complete successfully when there are no more enabled activities within its body. This causes its Exception BlockexceptionBlock, where present, to be deinstalled, Finalizer BlocksfinalizerBlocks to be installed if specified, and the Choreographychoreography enters the Successfully Completed State.

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

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

A Choreography,choreography in a Successfully Completed State with Finalzer Block(s)finalizerBlocks specified enters the Closed State when one of its installed Finalizer Block(s)finalizerBlocks is enabled and completed. The Finalizer BlockfinalizerBlock of a Choreographychoreography is enabled by a finalize activity in the immediately enclosing Choreography.choreography. Alternatively, a Choreographychoreography in a Successfully Completed State with Finalzer Block(s)finalizerBlocks specified implicitly enters the Closed State when its enclosing Choreographychoreography enters the Closed State without enabling the Finalizer Block(s)finalizerBlocks of its enclosed Choreography.choreography. In other words, when a Choreographychoreography enters the Closed State, all its enclosed successfully completed Choreographieschoreographies are implicitly entering the Closed State even if none of their Finalizer BlocksfinalizerBlocks has been enabled.

2.4.85.8 Choreography Exception Handling

A Choreographychoreography can sometimes fail as a result of an exceptional circumstance or an "error" that occurred during its performance. An Exception is caused in the Choreography when an Exception Variable is populated in an Interaction activity with the attribute causeException set to "true". An Exception MUST be propagated to all parties in the Choreography using explicitly modeled, Exception Causing Interactions when the Choreography is not coordinated. This causes the Choreography to enter the Exception state and its Exception Block to be enabled, if specified.Different types of errorsexceptions are possible including this non-exhaustive list:

  • Interaction Failures ,failures - for exampleexample, the sending of a message did not succeed

  • Protocol Based Exchangebased exchange failures ,- for exampleexample, no acknowledgement was received as part of a reliable messaging protocol

  • Security failures ,- for exampleexample, a Messagemessage was rejected by a recipient because the digital signature was not valid

  • Timeout errors ,- for exampleexample, an Interactioninteraction did not complete within the required time

  • Validation Errors ,errors - for exampleexample, an XML "Order" document was not well formed or did not conform to its XML-Schema definition

  • Application "failures" ,failures - for exampleexample, the "goods ordered""Goods Ordered" were 'out'Out of stock'

To handle these and other "errors" separate Exception Work UnitsWithin WS-CDL, one or more exception workunits MAY be defined inwithin the Exception BlockexceptionBlock of a Choreography,choreography for each Exceptionexception that needs to be handled. One or more Exception Work Unit(s) MAY be defined within the Exception Block of a Choreography.At least one Exception Work Unitexception workunit MUST be defined as part of the Exception BlockexceptionBlock of a Choreography.choreography.

An Exception Work Unitexception workunit MAY express interest on Exception informationthe occurrence of a particular type of exception using its guard condition on Exception Types or Exception Variables.with the hasExceptionOccurred WS-CDL function. If no guard condition is specified, then the Exception Work Unitexception workunit is called the Default Exception Work Unitdefault exception workunit and expresses interest on any type of Exception.exception. Within the Exception BlockexceptionBlock of a Choreographychoreography there MUST NOT be more than one Default Exception Work Unit.default exception workunit. An Exception Work Unitexception workunit MUST always set its block attribute to "false" and MUST NOT define a repetition condition.

Exception Work Units areworkunits MUST be enabled when the Exception BlockexceptionBlock of the Choreographychoreography they belong to is enabled. Enabled Exception Work Unitsexception workunits in a Choreographychoreography MAY behave as the mechanism to recover from Exceptions occuringexceptions occurring in this and its enclosed Choreographies.choreographies.

Within the Exception BlockexceptionBlock of a Choreographychoreography only one Exception Work Unitexception workunit MAY be matched.

The rules for matching an Exceptionexception are:

  • When an Exception Work Unitexception workunit has a guard condition using the hasExceptionOccurred(exceptionType) WS-CDL function, then it isMUST be matched when an Exception Variable with Exception Type thatthe "QName" value of a caused exception matches the parameterexceptionType is populated using an Exception Causing Interaction activityparameter specified

  • If an Exceptionexception is matched by the guard condition of an Exception Work Unit,exception workunit, then the actions of the matched Work Unitworkunit are enabled. When two or more Exception Work Unitsexception workunits are defined then the order of evaluating their guard conditions is based on the order that the Work Unitsworkunits have been defined within the Exception BlockexceptionBlock

  • If none of the guard condition(s)conditions match, then if there is a Default Exception Work Unitdefault exception workunit without a guard condition defined then its actions are enabled

  • If an Exceptionexception is not matched by an Exception Work Unitexception workunit defined within the Choreographychoreography in which the Exceptionexception occurs, the Exceptionexception will be recursively propagated to the Exception Work Unitexception workunit of the immediate enclosing Choreographychoreography until a match is successful

  • If an Exceptionexception occurs within a Choreography,choreography, then the Choreographychoreography completes unsuccessfully. In this case its Finalizer Block(s)finalizerBlocks MUST NOT be installed. The actions, including enclosed Choreographies,actions within this Choreographychoreography, including enclosed choreographies that have not completed, are completed abnormally before an Exception Work Unitexception workunit can be matched

The actions within the Exception Work Unitexception workunit MAY use Variablevariable information visible in the Visibility Horizonvisibility horizon of the Choreographychoreography it belongs to as they stand at the current time.

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

2.4.95.9 Choreography Finalization

After a Choreographychoreography 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 Finalizer Block(s)finalizerBlocks MAY be defined for an enclosed Choreography.choreography. When its Choreographychoreography body completes successfully, any Finalizer Blocks specified in the Choreographyand associated finalizerBlocks are specified, the finalizerBlocks MUST be installed.

If more than one Finalizer Blocks arefinalizerBlock is defined for the same Choreography,choreography, each of them MUST be differentiated by their name attributes. However, at most one Finalizer BlockfinalizerBlock MAY be enabled for any given Choreographychoreography instance during the subsequent progress, including Exceptionexception handling and finalization, of the enclosing Choreography. Finalizer Block(s)choreography.

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

  • A single Finalizer BlockfinalizerBlock to semantically "rollback" the Choreographychoreography

  • Two Finalizer Blocks,finalizerBlocks, for example one with name "confirm" and one with name "cancel", to implement a two-phase outcome protocol

  • One "undo" Finalizer Block along with afinalizerBlock and one "close" Finalizer Block to signal thatfinalizerBlock. If the "undo" Finalizer Block"close" finalizer is no longer able to beenabled, that is,then the Choreography is nowchoreography will be closed and the "undo" finalizerBlock can no longer be enabled

The actions within the Finalizer Work Unitfinalizer activity MAY use Variablevariable information visible in the Visibility Horizonvisibility horizon of the Choreographychoreography it belongs to as they were at the time the Choreographychoreography completed for the Variablesvariables belonging to this Choreographychoreography and as they stand at the current time for the Variablesvariables belonging to the enclosing Choreography.choreography.

The actions of a Finalizer Work Unitfinalizer activity MAY fault. The semantics for matching the fault and acting on it are the same as described in the previous section. 2.4.10Section 5.8.

5.10 Choreography Coordination

Choreography Coordinationcoordination guarantees that all involved RolesroleTypes will agree on how the Choreographychoreography ended. That is, all RolesroleTypes will agree on whether the Choreographychoreography completed successfully or suffered an Exception,exception, and if the Choreographychoreography completed successfully and Finalizer BlocksfinalizerBlocks were installed, all RolesroleTypes will agree on which Finalizer BlockfinalizerBlock was enabled. Such agreement differs from Interactioninteraction based alignment in that the Choreographycoordinated choreography as a whole is aligned, regardless of whether each Interactioninteraction in the Coordinated Choreographycoordinated choreography is aligned. In contrast to Alignment Interactions,alignment interactions, a Coordinated Choreographycoordinated choreography provides a larger unit of coordination - a set of Interactionsinteractions that end with shared knowledge among all the partiesparticipantTypes that their Relationshipcollaboration 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 RolesroleTypes will agree on how the Choreographychoreography ended.

Choreographies defined as requiring coordination must beingbe bound to a Coordinationcoordination protocol. When Choreography Coordinationchoreography coordination is not required, then the Choreographychoreography is not bound to a Coordination protocol, andcoordination protocol and, since none of the above guarantees of agreement on the outcome applyapply, any required coordination should be performed using explicitly modeled Interactions.interactions.

The implications of Choreography Coordinationchoreography coordination differ for root Choreographieschoreographies versus enclosed Choreographies:choreographies:

  • An enclosed Choreographychoreography MAY have one or more Finalizer Block(s).finalizerBlocks. In this case, coordination means that all RolesroleTypes agree on whether the Choreographychoreography completed successfully or suffered an Exception, and ifexception. If the Choreographychoreography completed successfully and Finalizer Block(s)finalizerBlocks were installed, all RolesroleTypes agree on which Finalizer BlockfinalizerBlock was enabled

  • A root Choreographychoreography can also be coordinated, but it cannotMUST NOT have any Finalizer Block(s).finalizerBlocks. In this case, coordination means that all RolesroleTypes agree on whether the Choreographychoreography completed successfully or suffered an Exceptionexception

  • In both cases, all RolesroleTypes MUST agree on whether the Choreographychoreography completed successfully, or if an Exceptionexception occurs, all RolesroleTypes MUST experience an Exceptionexception rather than successful completion. When an Exceptionexception occurs within a Choreography,choreography, the Coordinationcoordination protocol will throw an Exceptionexception to RolesroleTypes which have not otherwise detected the Exceptionexception that occurred

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.coordinated choreographies.

Example 1: Coordinated credit authorization without  Finalizer Block(s):finalizerBlocks:

<informationType name="creditDeniedType"  exceptionType="true"/>/>

<!-- Coordinated CreditAuthorization  choreographyChoreography without  Finalizer Block(s)-->finalizerBlocks-->
<choreography name="CreditAuthorization" root="false" coordination="true">
   <relationship type="tns:CreditReqCreditResp"/>
   <variableDefinitions>
      <variable name="CreditExtended" informationType="xsd:int" silent="true"       
                roleTypes="tns:CreditResponder"/>
      <variable name="creditRequest"/>
      <variable name="creditAuthorized"/>
      <variable name="creditDenied" informationType =  "creditDeniedType"/>"tns:creditDeniedType"/>
   </variableDefinitions>
   
   <!-- the normal work - receive the request and decide whether to approve -->
   <interaction name="creditAuthorization" channelVariable="tns:CreditRequestor" 
                operation="authorize">
      <participate relationshipType="SuperiorInferior"
                    fromRole="tns:Superior" toRole="Inferior"/>fromRoleTypeRef="tns:Superior" 
                   toRoleTypeRef="tns:Inferior"/>
      <exchange name="creditRequest" informationType="creditRequest" 
                action="request">
         <send  variable="tns:creditRequest"/>variable="getVariable('tns:creditRequest','','')"/>
         <receive  variable="tns:creditRequest"/>variable="getVariable('tns:creditRequest','','')"/>
      </exchange>
      <exchange name="creditAuthorized" informationType="creditAuthorizedType"   
                action="respond">
         <send  variable="tns:creditAuthorized"/>variable="getVariable('tns:creditAuthorized','','')"/>
         <receive  variable="tns:creditAuthorized"/>variable="getVariable('tns:creditAuthorized','','')"/>
      </exchange>
      <exchange name="creditDenied" informationType="creditDeniedType" 
                action="respond">
         <send  variable="tns:creditDenied" causeException="true"/>variable="getVariable('tns:creditDenied','','')"
                         causeException="tns:creditDenied"/>
         <receive  variable="tns:creditDenied" causeException="true"/>variable="getVariable('tns:creditDenied','','')"
                         causeException="tns:creditDenied"/>
      </exchange>
   </interaction>

   <!-- catch the (application) exception - as an exception it will abort the 
        choreography -->
   <exceptionBlock name="handleBadCreditException">
     <workunit  name="handleBadCredit" >
                <interaction name="badCreditInteraction" 
                             channelVariable="tns:CreditResponder"
                             operation="creditDenied">
                    <participate relationshipType="CreditReqCreditResp"
                          fromRole="tns:Responder" toRole="CreditRequestor"/>fromRoleTypeRef="tns:Responder"
                         toRoleTypeRef="tns:CreditRequestor"/>
      </interaction>
     </workunit>
  </exceptionBlock>
</choreography>
Example 2: Coordinated credit authorization with  Finalizer Block(s):finalizerBlocks

<informationType name="creditDeniedType"  exceptionType="true"/>/>

<!-- Coordinated CreditAuthorization  choreographyChoreography with  Finalizer Block(s)finalizerBlocks -->
<choreography name="CreditAuthorization" root="false" coordination="true">
   <relationship type="tns:CreditReqCreditResp"/>
   <variableDefinitions>
      <variable name="CreditExtended" informationType="xsd:int" silent="true"  
                roleTypes="tns:CreditResponder"/>
      <variable name="creditRequest"/>
      <variable name="creditAuthorized"/>
      <variable name="creditDenied" informationType = "creditDeniedType"/>
   </variableDefinitions>

   <!-- the normal work -receive the request and decide whether to approve -->
   <interaction name="creditAuthorization" channelVariable="tns:CreditRequestor"  
                operation="authorize">
      <participate relationshipType="SuperiorInferior"
                    fromRole="tns:Superior" toRole="Inferior"/>fromRoleTypeRef="tns:Superior" 
                   toRoleTypeRef="tns:Inferior"/>
      <exchange name="creditRequest" informationType="creditRequest"  
             action="request">
         <send variable="tns:creditRequest"/>
         <receive variable="tns:creditRequest"/>
      </exchange>
      <exchange name="creditAuthorized" informationType="creditAuthorizedType" 
                action="respond">
         <send variable="tns:creditAuthorized"/>
         <receive variable="tns:creditAuthorized"/>
      </exchange>
      <exchange name="creditDenied" informationType="creditDeniedType" 
                action="respond">
         <send variable="tns:creditDenied"  causeException="true"/>causeException="tns:creditDenied"/>
         <receive variable="tns:creditDenied"  causeException="true"/>causeException="tns:creditDenied"/>
      </exchange>
   </interaction>

   <!-- catch the (application) exception - as an exception it will abort the 
        choreography and the  Finalizer Block(s)finalizerBlocks are not accessible -->
   <exceptionBlock name="handleBadCreditException">
       <workunit  name="handleBadCredit" >
          <interaction name="badCreditInteraction" 
                channelVariable="tns:CreditResponder"
                operation="creditDenied">
                <participate relationshipType="CreditReqCreditResp"
                       fromRole="tns:Responder" toRole="CreditRequestor"/>fromRoleTypeRef="tns:Responder"
                      toRoleTypeRef="tns:CreditRequestor"/>
          </interaction>
       </workunit>
   </exceptionBlock>

   <!--  Finalizer Block(s)finalizerBlocks -->
   <!-- what to do if the credit is drawn down -->
   <finalizerBlock name="drawDown">
      <!-- if there is no application content to send, this could just be an 
           assignment to the statecapturevariable creditExtended -->
       <workunit  name="drawdown" >
            <interaction name="drawdownInteraction" 
                         channelVariable="tns:CreditRequestor"
                         operation="drawDown">
                  <participate relationshipType="CreditReqCreditResp"
                       fromRole="tns:CreditRequestor" toRole="CreditResponder"/>fromRoleTypeRef="tns:CreditRequestor"
                      toRoleTypeRef="tns:CreditResponder"/>
                  <exchange name="dummy" action="request">
                      <send></send>
                      <receive recordReference="drawdownRecord"/>
                  </exchange>  
                 <record name="drawdownRecord" when="before">
                      <source expression="drawnDown"/>
                      <target variable="CreditExtended"/>
                  </record>               
            </interaction>
           </workunit>
   </finalizerBlock>

   <!-- what to do if the credit is not used -->
   <finalizerBlock name="replenish">      
   <!-- if there is no application content to send, this could just be an  
           assignment to the state capturing variable creditExtended -->
       <workunit name="replenishWU">
            <interaction name="replenishInteraction" 
                         channelVariable="tns:CreditRequestor"
                         operation="replenish">
                <participate relationshipType="CreditReqCreditResp"
                       fromRole="tns:CreditRequestor" toRole="CreditResponder"/>fromRoleTypeRef="tns:CreditRequestor"
                      toRoleTypeRef="tns:CreditResponder"/>
                <exchange name="dummy" action="request">
                     <send></send>
                       <receive recordReference="replenishRecord"/>
                </exchange>                
                <record name="replenishRecord" when="before">
                       <source expression="released"/>
                       <target variable="CreditExtended"/>
                </record>
             </interaction>
        </workunit>
   </finalizerBlock>
</choreography>        

2.56 Activities

Activities are the lowest level components of the Choreography, used todescribe the actual work performed.actions performed within a choreography. The Activity-Notation is used to define activities as either:

2.5.16.1 Ordering Structures

AnOrdering Structurestructures 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:

  • Sequence Parallel Choice 2.5.1.1sequence

  • parallel

  • choice

6.1.1 Sequence

The sequence ordering structure contains one or more Activity-Notations. When the sequence activity is enabled, the sequence element restrictsMUST 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:

<sequence>
    Activity-Notation+
</sequence>

2.5.1.26.1.2 Parallel

The parallel ordering structure contains one or more Activity-NotationActivity-Notations that are enabled concurrently when the parallel activity is enabled. The parallel activity completesMUST 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:

<parallel>
    Activity-Notation+
</parallel>

2.5.1.36.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 Work Unitsworkunits with guard conditions, the first Work Unitworkunit that matches the guard condition is selected and the other Work Unitsworkunits 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 thethose activities are non-observable.

The syntax of this construct is:

<choice>
    Activity-Notation+
</choice>

In the example below, choice element has two Interactions,interactions, "processGoodCredit" and "processBadCredit". The Interactionsinteractions have the same directionality, participate within the same RelationshiprelationshipType and have the same fromRolesfromRoleTypeRef and toRolestoRoleTypeRef names. If one Interactioninteraction happens, then the other one is disabled.

<choice>
  <interaction name=""processGoodCredit"
       channelVariable="goodCredit-channel" operation="doCredit">
      ...
  </interaction>

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

2.5.26.2 Interacting

An Interactioninteraction is the basic building block of a Choreography, whichchoreography. It results in information exchanged between collaborating partiesparticipants and possibly the synchronization of their observable information changes and the values of the exchanged information.

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

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

An Interactioninteraction also contains "references" to:

  • The Channel Capturing Variable that specifies the interface and other datachannel capturing variable that describedescribes where and how the message is to be sent to and received into the accepting RoleroleType

  • The Operationoperation that specifies what the recipient of the message should do with the message when it is received

  • The From Role'from' roleType and To Role'to' roleType that are involved

  • The Information TypeinformationType or Channel TypechannelType that is being exchanged

  • The Information Exchange Capturing Variablesinformation exchange capturing variables at the From Role'from' roleType and To Role'to' roleType that are the source and destination for the message content

  • A list of potential observable information changesstate capturing variable recordings that can occur and may need to be aligned at the From Role and the To Role,capture observable information changes that can occur as a result of carrying out the Interaction 2.5.2.1interaction

6.2.1 Interaction Based Information Alignment

In some Choreographieschoreographies there may be a requirement that,that when the Interactioninteraction is performed, the RolesroleTypes in the Choreographychoreography have agreement on the outcome. More specifically within an Interaction,interaction, a Role MAYroleType may need to have a common understanding of the observable information creations or changes of one or more State Capturing Variablesstate capturing variables that are complementary to one or more State Capturing Variablesstate capturing variables of its partner Role.roleType. Additionally, within an Interactioninteraction a Role MAYroleType may need to have a common understanding of the values of the Information Exchange Capturing Variablesinformation exchange capturing variables at the partner Role.roleType.

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

  • State Capturing Variables,capturing variables, such as "Order State", that contain observable information at the Buyer"Buyer" and Seller,"Seller", have values that are complementary to each other, e.g. "Sent"'Sent' at the Buyer"Buyer" and "Received"'Received' at the Seller,"Seller", and

  • Information Exchange Capturing Variablesexchange capturing variables have the same types with the same content, e.g. The "Order" Variablesvariables at the Buyer"Buyer" and Seller"Seller" have the same Information TypesinformationTypes and hold the same order information

In WS-CDL, an Alignment Interactionalignment interaction MUST be explicitly used,used in the cases where two interacting partiesparticipants require the alignment of their observable information changes and the values of their exchanged information. After the alignment Interactioninteraction completes, both partiesparticipants progress at the same time,time in a lock-step fashionfashion, and the Variablevariable information in both partiesparticipants is aligned. Their Variablevariable alignment comes from the fact that the requesting partyparticipant has to knowbe assured that the accepting partyparticipant has received the messagemessage, and the other way around, theaccepting partyparticipant has to knowbe assured that the requesting partyparticipant has sent the message before both of them progress. There is no intermediate state, where one partyparticipant sends a message and then it proceeds independentlyindependently, or the other partyparticipant receives a message and then it proceeds independently. 2.5.2.2In 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 completesinteraction MUST complete normally when its message exchange(s)exchanges complete successfully.

An Interaction completesinteraction MUST complete abnormally when:

  • An application signals an error condition during the management of a request or within a partyparticipant when processing the request

  • TheIts time-to-complete timeout, identifying the timeframe within which an Interaction MUST complete,timeout occurs after the Interactioninteraction was initiated but before it completed

  • Other typesSome other type of errors,error occurs, such as Protocol Based Exchangeprotocol based exchange failures, Securitysecurity failures, Document Validationdocument validation errors, etc.

2.5.2.36.2.3 Interaction Syntax

The syntax of the interaction construct is:

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

   <participate   relationshipType="qname" fromRole="qname" toRole="qname"relationshipType="QName"
                 fromRoleTypeRef="QName" toRoleTypeRef="QName" />

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

   <timeout  time-to-complete="XPath-expression"
              fromRoleRecordReference="listfromRoleTypeRecordRef="list of  ncname"? toRoleRecordReference="listNCName"?
             toRoleTypeRecordRef="list of  ncname"?NCName"? />?

   <record   name="ncname"name="NCName"
            when="before"|"after"|"timeout"
             causeException="true"|"false"?causeException="QName"? >
     <source  variable="XPath-expression"? |  expression="Xpath-expression"?expression="XPath-expression"? />
     <target  variable="XPath-expression" />
   </record>*
</interaction>

The attribute name is used for specifyingto specify a name for each Interactioninteraction element declared within a Choreography.choreography.

The channelVariable attribute specifies the Channel Variable containingchannel capturing variable used for communicating during this interaction. The channel variable contains information of a party, beingabout the participant that is the target of the Interaction, whichinteraction. The information is used for determining where and how to send and receive information to and intofrom the party.participant. The Channel Variablechannel variable used in an Interactioninteraction MUST be available at the two RolesroleTypes before the Interaction occurs.interaction MAY occur. At runtime, information about a Channel Variablechannel variable is expanded further. This requires that the messages exchanged in the Choreographychoreography also contain reference and correlation information, for example by:

  • Including a protocol header, such as a SOAP header or

  • Using the actual value of data within a message, for example the "Order Number" of the Order"Order" that is common to all the messages sent over the Channelchannel

The operation attribute specifies the name of the operation that is associated with this Interaction.interaction. The specified operation belongs to the interface, as identified by the roleroleType and behavior elements of the Channel Type ofchannelType specified in the Channel Variablechannel variable used in this Interaction.interaction.

The OPTIONAL align attributeattribute, when set to "true""true", means that this Alignment Interactionalignment interaction results in the common understanding of both the information exchanged and the resulting observable information creations or changes at the ends of the Interactioninteraction, as specified in the fromRolefromRoleTypeRef 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 toRole.information recorded. The default value for this attribute is "false".

An Interaction activity can be marked as a Choreography Initiator whenWhen the OPTIONAL initiate attribute is set to "true"."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 Relationship TyperelationshipType this Interactioninteraction participates inin, and the fromRolefromRoleTypeRef and toRoletoRoleTypeRef attributes specify the requesting and the accepting Role TypesroleTypes respectively. The Role Typetype of the roleType identified by the toRoletoRoleTypeRef attribute MUST be the same as the Role TyperoleType identified by the roleroleType element of the Channel Type ofchannelType specified in the Channel Variablechannel variable used in the interaction activity.interaction.

The OPTIONAL exchange element allows information to be exchanged during an Interaction.interaction. The attribute name is used for specifyingto 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:

  • For WSDL1.1, the LocalPart of the "QName" will be used to match the name of a fault declared within the operation. If a prefix is specified, it must match the namespace associated with the operation. If a WSDL1.1 operation has more than one fault reference with the same LocalPart as the name specified in the faultName attribute, this will be considered an error

  • For WSDL2, the fully qualified "QName" will be used to match the fault declaration. If only the LocalPart of the "QName" is specified, then the match will initially be performed using the targetNamespace to qualify the LocalPart. If a fault declaration is still not found, then the LocalPart will be matched against the LocalPart of the 'ref' attribute of each fault reference defined for the operation. If a WSDL2 operation has more than one fault reference with the same LocalPart as the name specified in the faultName attribute, this will be considered an error

Within the exchange element, the OPTIONAL attributes informationType and channelType identify the Information TypeinformationType or the Channel TypechannelType of the information that is exchanged between the two RolesroleTypes in an Interaction.interaction. The attributes informationType and channelType areMUST 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 Choreographychoreography definition.

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

  • When the action attribute is set to "request", then the information exchange happens fromRolefrom the 'from' roleType to toRolethe 'to' roleType

  • When the action attribute is set to "respond", then the information exchange happens from toRolethe 'to' roleType to fromRolethe 'from' roleType

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

  • The send and the receive elements MUST only use the WS-CDL function getVariable within the variable attribute

  • The OPTIONAL Variablesvariables specified within the send and receive elements MUST be of type as described in the informationType or channelType attributes

  • When the action element is set to "request", then the Variablevariable specified within the send element using the variable attribute MUST be defined at the fromRole'from' roleType and the Variablevariable specified within the receive element using the variable attribute MUST be defined at the toRole'to' roleType. A variable is associated with a specific roleType as described in Section 5.2

  • When the action element is set to "respond", then the Variablevariable specified within the send element using the variable attribute MUST be defined at the toRole'to' roleType and the Variablevariable specified within the receive element using the variable attribute MUST be defined at fromRole'from' roleType. A variable is associated with a specific roleType as described in Section 5.2

  • The Variablevariable specified within the receive element MUST notNOT be defined with the attribute silent set to "true"

  • Within the send or the receive element(s)elements of an exchange element, the recordReference attribute contains an XML-Schema list of references to record element(s)elements in the same Interaction.interaction. The same record element MAY be referenced from different send or the receive element(s)elements within the same Interactioninteraction thus enabling re-use

  • Within the send or the receive element(s)elements of an exchange element, if the OPTIONAL causeException attribute when set to "true",is set, it specifies that an Exceptionexception MUST be caused at the respective Roles.roleTypes. In this case, the informationType"QName" value of this attribute will identify the exchange elementexception that MUST be of Exception Type. The default for this attribute is "false"caused

  • The request exchange MUST NOT have the faultName or causeException attribute set to "true"attributes specified

  • When two or more respond exchanges are specified, one respond exchange MAY be of normal informationType and all othersspecified there MUST be of Exception Type. There isan implicit choice between two or more respond exchanges

  • If the align attribute is set to "false" for the Interaction,interaction, then it means that the:

    • Request exchange completes successfully for the requesting RoleroleType once it has successfully sent the information of the Variablevariable specified within the send element and the Request exchange completes successfully for the accepting RoleroleType once it has successfully received the information of the Variablevariable specified within the receive element
    • Response exchange completes successfully for the accepting RoleroleType once it has successfully sent the information of the Variablevariable specified within the send element and the Response exchange completes successfully for the requesting RoleroleType once it has successfully received the information of the Variablevariable specified within the receive element
  • If the align attribute is set to "true" for the Interaction,interaction, then it means that the Interaction completesinteraction MUST complete successfully if its Request and Response exchanges complete successfullysuccessfully, and all referenced records complete successfully:

    • A Request exchange completes successfully once both the requesting RoleroleType has successfully sent the information of the Variablevariable specified within the send element and the accepting RoleroleType has successfully received the information of the Variablevariable specified within the receive element
    • A Response exchange completes successfully once both the accepting RoleroleType has successfully sent the information of the Variablevariable specified within the send element and the requesting RoleroleType has successfully received the information of the Variablevariable specified within the receive element

Within the OPTIONAL timeout element, the time-to-complete attribute identifies the timeframe within which an Interactioninteraction MUST complete after it was initiatedinitiated, or the deadline before which an Interactioninteraction 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. TheWhen used, the OPTIONAL fromRoleRecordReferencefromRoleTypeRecordRef attribute contains an XML-Schema list of references to record element(s)elements in the same Interactioninteraction that willSHOULD take effect at the fromRole'from' roleType when a timeout occurs. TheWhen used, the OPTIONAL toRoleRecordReferencetoRoleTypeRecordRef attribute contains an XML-Schema list of references to record element(s)elements in the same Interactioninteraction that willSHOULD take effect at the toRole'to' roleType when a timeout occurs.

The OPTIONAL elementrecord element is used to create or change and then make available within one Role,roleType, the value of one or more Variablesvariables using another Variablevariable or an expression. The attribute name is used for specifyingto specify a distinct name for a record element within an Interaction.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:interaction:

  • When the action element is set to "request", then the recording(s)recordings specified within the source and the target elements MUST occur at the fromRole'from' roleType for the send and at the toRole'to' roleType for the receive

  • When the action element is set to "response", then the recording(s)recordings specified within the source and the target elements MUST occur at the toRole'to' roleType for the send and at the fromRole'from' roleType for the receive

Within the record element, the when attribute specifies if a recording happens before or after a sendthe send, or "before"before or "after" aafter the receive of a message at a RoleroleType 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 source MUST define either a variable attribute or an expression attribute

    • When the source defines an expression attribute, it MUST contain expressions, as defined in Section 2.4.3.5.3. The resulting type of the defined expression MUST be compatible with the target Variablevariable type
    • When the source defines a Variable,variable, then the source and the target Variablevariable MUST be of compatible type
  • When the source defines a Variable,variable, then the source and the target Variablevariable MUST be defined at the same RoleroleType. When the attribute variable is defined it MUST use only the WS-CDL function getVariable . The variable specified within this function is associated with a specific roleType as described in Section 5.2

  • The target Variablevariable MUST NOT be defined with the attribute silent set to "true"

  • One or more record elements MAY be specified and performed at one or both the RolesroleTypes within an Interactioninteraction

  • A record element MUST NOT be specified in the absence of an exchange element or a timeout element that reference it

  • The attribute causeException MAY be set to "true" in a record element if the target Variable is an Exception VariableWhen the OPTIONAL attribute causeException is set to "true"specified in a record element, then an exception MAY be caused at the corresponding Role gets intoroleType. In this case, the Exception state"QName" value of this attribute will identify the exception that MAY be caused

  • When two or more record elements are specified for the same RoleroleType in an Interactioninteraction, with target Variables of Exception Type,their causeException attributes set to indicate that an exception should be caused, then one of the Exception recordingsexception types MAY occur. An Exception recording hasbe caused. The throwing of an exception has a non-observable predicate condition,condition associated implicitly with it, that decides if an Exception occursexception is caused

  • If the align attribute is set to "false" for the Interaction,interaction, then it means that the RoleroleType specified within the record element makes available the creation or change of the information specified within the record element immediately after the successful completion of each record

  • If the align attribute is set to "true" for the Interaction,interaction, then it means that

    • Both Roles knowroleTypes SHOULD be assured of the availability of the creation or change of the information specified within the record element only at the successful completion of the Interactioninteraction
    • If there are two or more record elements specified within an Interaction,interaction, then all record operations MUST complete successfully for the Interactinteraction to complete successfully. Otherwise, none of the Variablesvariables specified in the target attribute will be affected

The example below shows a complete Choreographychoreography that involves one Interactioninteraction performed from Role Typea roleType "Consumer" to Role Typea roleType "Retailer" on the Channelchannel "retailer-channel" as a request/response exchange:

  • The message "purchaseOrder" is sent from the "Consumer" to the "Retailer" as a request message

  • The message "purchaseOrderAck" is sent from the "Retailer" to the "Consumer" as a response message

  • The Variablevariable "consumer-channel" is made available at the "Retailer" using the record element

  • The Interactioninteraction happens on the "retailer-channel", which has a Tokentoken "purchaseOrderID" used within the identity element of the Channel.channel. This identity element is used to identify the business process of the "Retailer"

  • The request message "purchaseOrder" contains the identity of the "Retailer" business process as specified in the tokenLocator for "purchaseOrder" message

  • The response message "purchaseOrderAck" contains the identity of the "Consumer" business process as specified in the tokenLocator for "purchaseOrderAck" message

  • The "consumer-channel" is sent as a part of "purchaseOrder" Interactioninteraction from the "Consumer" to the "Retailer" on "retailer-channel" during the request. Here the record element makes available the "Consumer-channel" at the "Retailer" Role.roleType. If the align attribute was set to "true" for this Interaction,interaction, then it also means that the "Consumer" knows that the "Retailer" now has the contact information of the "Consumer". In another example, the "Consumer" could set its Variablevariable "OrderSent" to "true" and the "Retailer" would set its Variablevariable "OrderReceived" to "true" using the record element

  • The exchange "badPurchaseOrderAckException" specifies that an Exceptionexception type of "badPOAckType" Exception Type"badPOAck" could occur at both partiesparticipants

<?xml version="1.0" encoding="UTF-8"?>
<package  xmlns="http://www.w3.org/2004/12/ws-chor/cdl"xmlns="http://www.w3.org/2005/10/cdl"
     xmlns:cdl="http://www.w3.org/2005/10/cdl"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.oracle.com/ashwini/sample" xmlns:tns=http://www.oracle.com/ashwini/sample"xmlns:rns="http://www.example.com/ConsumerRetailerChoreographyIFsample"
     xmlns:tns="http://www.example.com/ConsumerRetailerChoreographysample"
     targetNamespace="http://www.example.com/ConsumerRetailerChoreographysample"
     name="ConsumerRetailerChoreography"
     version="1.0">
 
  <informationType name="purchaseOrderType" type="tns:PurchaseOrderMsg"/>
  <informationType name="purchaseOrderAckType" type="tns:PurchaseOrderAckMsg"/>
  <informationType name="badPOAckType"  type="xsd:QName" />
  <informationType name="uriType"  type="xsd:string"  exceptionType="true"/>/>
  <informationType name="intType"  type="xsd:integer" />
 
  <token name="purchaseOrderID" informationType="tns:intType"/>
  <token name="retailerRef" informationType="tns:uriType"/>
  <token name="consumerRef" informationType="tns:uriType"/>
  <tokenLocator tokenName="tns:purchaseOrderID"
                informationType="tns:purchaseOrderType" query="/PO/orderId"/>
  <tokenLocator tokenName="tns:purchaseOrderID"
                informationType="tns:purchaseOrderAckType" query="/PO/orderId"/>
  <roleType name="Consumer">
    <behavior name="consumerForRetailer"  interface="tns:ConsumerRetailerPT"/>interface="rns:ConsumerRetailerPT"/>
    <behavior name="consumerForWarehouse"  interface="tns:ConsumerWarehousePT"/>interface="rns:ConsumerWarehousePT"/>
  </roleType>
  <roleType name="Retailer">
    <behavior name="retailerForConsumer"  interface="tns:RetailerConsumerPT"/>interface="rns:RetailerConsumerPT"/>
  </roleType>

  <relationshipType name="ConsumerRetailerRelationship">
     <role type="tns:Consumer"<roleType typeRef="tns:Consumer" behavior="consumerForRetailer"/>
     <role type="tns:Retailer"<roleType typeRef="tns:Retailer" behavior="retailerForConsumer"/>
  </relationshipType>

  <channelType name="ConsumerChannel">
     <role type="tns:Consumer"/><roleType typeRef="tns:Consumer"/>
    <reference>
      <token name="tns:consumerRef"/>
    </reference>
    <identity>
      <token name="tns:purchaseOrderID"/>
    </identity>
  </channelType>
  <channelType name="RetailerChannel">
    <passing channel="ConsumerChannel" action="request" />
     <role type="tns:Retailer"<roleType typeRef="tns:Retailer" behavior="retailerForConsumer"/>
    <reference>
      <token name="tns:retailerRef"/>
    </reference>
    <identity>
      <token name="tns:purchaseOrderID"/>
    </identity>
  </channelType>
 
  <choreography  name="ConsumerRetailerChoreography" root="true">name="ConsumerRetailerChoreography">
    <relationship type="tns:ConsumerRetailerRelationship"/>
    <variableDefinitions>
      <variable name="purchaseOrder" informationType="tns:purchaseOrderType" 
                 silent="true"silent="false" />
      <variable name="purchaseOrderAck" 
                informationType="tns:purchaseOrderAckType" />
      <variable name="retailer-channel" channelType="tns:RetailerChannel"/>
      <variable name="consumer-channel" channelType="tns:ConsumerChannel"/>
      <variable name="badPurchaseOrderAck"   
                informationType="tns:badPOAckType"  roleTypes="tns:Consumer"/> <variable name="badPurchaseOrderAck" informationType="tns:badPOAckType" roleTypes="tns:Retailer" silent="true"/>
    </variableDefinitions>
 
    <interaction name="createPO"
                 channelVariable="tns:retailer-channel" 
                 operation="handlePurchaseOrder"  align="true" initiate="true">>
      <participate relationshipType="tns:ConsumerRetailerRelationship" 
                    fromRole="tns:Consumer" toRole="tns:Retailer"/>fromRoleTypeRef="tns:Consumer" toRoleTypeRef="tns:Retailer"/>
      <exchange name="request" 
                informationType="tns:purchaseOrderType" action="request">
        <send  variable="cdl:getVariable("tns:purchaseOrder", "", "")"variable="cdl:getVariable('tns:purchaseOrder','','')" />
        <receive  variable="cdl:getVariable("tns:purchaseOrder", "", "")"variable="cdl:getVariable('tns:purchaseOrder','','')"
                 recordReference="record-the-channel-info" />
      </exchange>
      <exchange name="response"
                informationType="purchaseOrderAckType" action="respond">
        <send  variable="cdl:getVariable("tns:purchaseOrderAck", "", "")"variable="cdl:getVariable('tns:purchaseOrderAck','','')" />
        <receive  variable="cdl:getVariable("tns:purchaseOrderAck", "", "")"variable="cdl:getVariable('tns:purchaseOrderAck','','')" />
      </exchange>
      <exchange name="badPurchaseOrderAckException" faultName="badPurchaseOrderAckException"
                informationType="badPOAckType" action="respond">
        <send  variable="cdl:getVariable(,tns:badPurchaseOrderAck,, ,,, ,,)" causeException="true"variable="cdl:getVariable('tns:badPurchaseOrderAck','','')"
                causeException="tns:badPOAck" />
        <receive  variable="cdl:getVariable("tns:badPurchaseOrderAck", "", "")" causeException="true"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")"/>variable="cdl:getVariable('tns:purchaseOrder','', 
                                          '/PO/CustomerRef')"/>
        <target  variable="cdl:getVariable("tns:consumer-channel", "", "")"/>variable="cdl:getVariable('tns:consumer-channel','','')"/>
      </record>
    </interaction>
 </choreography>    
</package>

2.5.36.3 Composing Choreographies

The perform activity realizes the "compositioncomposition of Choreographies", whereaschoreographies by combining existing Choreographies results in the creation ofchoreographies to create new Choreographies.ones. For exampleexample, if two separate Choreographieschoreographies were defined as follows:

  • A "Request for Quote" ("RFQ") Choreographychoreography that involves a "Buyer" RoleroleType sending a request for a quotation for goods and services to a "Supplier" RoleroleType to which the "Supplier" RoleroleType responds with either a "Quotation" or a "Decline to Quote" message, and

  • An "Order Placement" Choreography,choreography, where the "Buyer" RoleroleType places andan order for goods or services and the "Supplier" RoleroleType either accepts the order or rejects it

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

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

The syntax of the perform construct is:

<perform   choreographyName="qname"choreographyName="QName" 
          choreographyInstanceId="XPath-expression"? 
          block="true|false"? >
   <bind   name="ncname">name="NCName">
     <this variable="XPath-expression"  role="qname"/>roleType="QName"/>
     <free variable="XPath-expression"  role="qname"/>roleType="QName"/>
   </bind>*
   Choreography-Notation?
</perform>

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

The OPTIONAL choreographyInstanceId attribute defines an identifier for this performance of the Choreographychoreography identified by the choreographyName attribute. If the performed Choreographychoreography can only be performed once within the enclosing Choreography,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 Work Unitworkunit that can repeat, then each use of perform must assign a different ChoreographyInstanceIdchoreographyInstanceId 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 Locallylocally defined Choreographychoreography 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 Choreographychoreography to be shared with the performed Choreographychoreography and vice versa. Within the bind element, the attribute name is used for specifyingto specify a name for each bind element declared within this perform activity. Within the bind element, the roleroleType attribute aliases the RolesroleTypes from the performing Choreographychoreography to the performed Choreography.choreography.

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

The following rules apply:

  • The Choreographychoreography to be performed MUST be either a Locallylocally defined Choreographychoreography that is immediately contained within the performing Choreographychoreography or a Globallyglobally defined Choreography.choreography. Performed Choreographieschoreographies that are declared in a different Choreography Packagechoreography package MUST be included first before they can be performed

  • The Role TypesroleTypes within a single bind element MUST be carried out by the same party,participant, hence they MUST belong to the same Participant TypeparticipantType

  • The variable attribute within this element and free element MUST define only the WS-CDL function getVariable

  • The free Variablesvariables specified within the free element MUST have the attribute free set to "true" in their definition within the performed Choreographychoreography

  • There MUST notNOT be a cyclic dependency on the Choreographieschoreographies performed. For example, Choreographychoreography "C1" is performing Choreographychoreography "C2" which is performing Choreographychoreography "C1" again is disallowed

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

<choreography name="PurchaseChoreography">
   ...
   <variableDefinitions>
      <variable name="purchaseOrderAtRetailer"
             informationType="purchaseOrder"  role="tns:Retailer"/>roleTypes="tns:Retailer"/>
   </variableDefinitions>
   ...
   <perform choreographyName="RetailerWarehouseChoreography">
      <bind name="aliasRetailer">
        <this  variable="cdl:getVariable("tns:purchaseOrderAtRetailer", "", "")" role="tns:Retailer"/>variable="cdl:getVariable('tns:purchaseOrderAtRetailer','','')"
             roleType="tns:Retailer"/>
        <free  variable="cdl:getVariable("tns:purchaseOrder", "", "")" role="tns:Retailer"/>variable="cdl:getVariable('tns:purchaseOrder','','')"
             roleType="tns:Retailer"/>
      </bind>
   </perform>
    ...
</choreography>

<choreography name="RetailerWarehouseChoreography">
    <variableDefinitions>
       <variable name="purchaseOrder"
          informationType="purchaseOrder"  role="tns:Retailer"roleTypes="tns:Retailer" free="true"/>
    </variableDefinitions>
     ...
</choreography>

2.5.46.4 Assigning Variables

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

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

The syntax of the assign construct is:

<assign   roleType="qname">roleType="QName">
   <copy   name="ncname" causeException="true"|"false"?name="NCName" causeException="QName"? >
      <source   variable="XPath-expression"?|expression="Xpath-expression"?variable="XPath-expression"?|expression="XPath-expression"? />
      <target  variable="XPath-expression" />
   </copy>+
</assign>

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

The following rules apply to assignment:

  • The source MUST define either a variable attribute or an expression attribute

    • When the source defines an expression attribute, it MUST contain expressions,an expression, as defined in Section 2.4.3.5.3. The resulting type of the defined expression MUST be compatible with the target Variablevariable type
    • When the source defines a Variable,variable, then the source and the target Variablevariable MUST be of compatible type
    • When the source defines a Variable,variable, then the source and the target Variablevariable MUST be defined at the same RoleroleType
  • When the attribute variable is defined it MUST use only the WS-CDL function getVariable

  • The target Variablevariable MUST NOT be defined with the attribute silent set to "true"

  • When two or more copy elements belong to the same assign element, then they are performed in the order in which they are defined

  • If there are two or more copy elements specified within an assign, then all copy operations MUST complete successfully for the assign to complete successfully. Otherwise, none of the Variablesvariables specified in the target attribute will be affected

  • The OPTIONAL attribute causeException MAY be set to "true" in a copy element if the target Variable is an Exception Variable. The default for this attribute is "false"At most one copy element MAY have the OPTIONAL attribute causeException set to "true"specified

  • When the attribute causeException is set to "true"specified in a copy element, then an exception SHOULD be caused at the RoleroleType specified by the attribute roleType gets into the Exception stateafter the assign activity has completedcompleted. In this case, the "QName" value of the causeException attribute will identify the exception that SHOULD be caused

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

Example 1:

<assign roleType="tns:Retailer">
  <copy name="copyAddressInfo">
    <source  variable="cdl:getVariable("PurchaseOrderMsg", "", "/PO/CustomerAddress")"variable="cdl:getVariable('PurchaseOrderMsg','',
                                      '/PO/CustomerAddress')" />
    <target  variable="cdl:getVariable("CustomerAddress", "", "")"variable="cdl:getVariable('CustomerAddress','','')" />
  </copy>
</assign>

Example 2:

<assign roleType="tns:Retailer">
  <copy name="copyPriceInfo">
    <source expression="(10+237)/34" />
    <target  variable="cdl:getVariable("ProductPrice", "", "", "tns:Retailer")"variable="cdl:getVariable('ProductPrice','','','tns:Retailer')" />
  </copy>
</assign>

Example 3:

<assign roleType="tns:Customer">
  <copy name="copyLiteral">
    <source  expression="Hello World"expression="'Hello World'" />
    <target  variable="cdl:getVariable("VarName", "", "", "tns:Customer")"variable="cdl:getVariable('VarName','','','tns:Customer')" />
  </copy>
</assign>

2.5.56.5 Marking Silent Actions

The Silent ActionsilentAction activity is an explicit designator used for marking the point where partyparticipant 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 parties,participants, but the fact that the inventory level does influence the global observable behavior with a buyer party"Buyer" needs to be specified in the Choreographychoreography definition.

The syntax of the silent actionsilentAction construct is:

<silentAction  roleType="qname?roleType="QName"? />

The OPTIONAL attribute roleType is used to specify the partyparticipant at which the silent actionsilentAction will be performed. If a silent action is defined without a Role Type,roleType, it is implied that the action is performed at all the Role TypesroleTypes that are part of the Relationshipsrelationships of the Choreographychoreography this activity is enclosed within.

2.5.66.6 Marking the Absence of Actions

The No ActionnoAction activity is an explicit designator used for marking the point where a partyparticipant 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.

   <exceptionBlock name="handleTimeoutException">
     <workunit  name="handleTimeoutException" >
                <noAction>
     </workunit>
  </exceptionBlock>

The syntax of the no actionnoAction construct is:

<noAction  roleType="qname?roleType="QName? />

The OPTIONAL attribute roleType is used to specify the partyparticipant at which no action will be performed. If a noAction is defined without a Role Type,roleType, it is implied that no action will be performed at any of the Role TypesroleTypes that are part of the Relationshipsrelationships of the Choreographychoreography this activity is enclosed within.

2.5.76.7 Finalizing a Choreography

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

A Choreographychoreography that does not perform any Choreographieschoreographies that have Finalizer Block(s)finalizerBlocks defined MUST NOT have any finalize activities specified within it. A finalize activity MAY be present within a Choreographychoreography that has performed a Choreographychoreography with one or more defined Finalizer Block(s)finalizerBlocks - that is a finalize activity can be specified within the Choreographychoreography body, within an Exception BlockexceptionBlock and within Finalizer Blocks.finalizerBlocks.

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

The syntax of the finalize construct is:

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

</finalizerReference>+ </finalize>The OPTIONAL attribute name is used for specifyingto specify a distinct name for each finalize element declared within a Choreography Package. Each finalizerReference elementchoreography package.

The finalize activity enables a Finalizer BlockfinalizerBlock in a performed instance of an immediately enclosed Choreography. Within a finalize element, each finalizerReference MUST refer to a different performed Choreography instance. Within the finalizerReference element, theof an immediately enclosed choreography.

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

Within the finalizerReference element, theThe OPTIONAL choreographyInstanceId attribute identifies the performed Choreographychoreography 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 Choreographychoreography is such that only one instance of the Choreographychoreography identified by the choreographyName attribute could have been performed when the finalize activity is enabled. If more than one instance of the Choreographychoreography identified by the choregraphyName attribute could have been performed, then the choreographyInstanceId attribute MUST be present.

Within the finalizerReference element, theThe attribute finalizerName indicates which Finalizer BlockfinalizerBlock is to be enabled in the performed instance. If the targeted, immediately enclosed, Choreographychoreography has onlymore than one defined Finalizer Block,finalizerBlock, then the finalizerName attribute is OPTIONAL.MUST be present.

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

<choreography name="CreditDecider">
 
    <!-- only a snippet is shown here -->

    <parallel>
        <perform name="creditForA"
            choreographyName="CoordinatedCreditAuthorization" 
             choreographyInstance="creditForA">choreographyInstanceId="'creditForA'">
            <!-- bind such that this does the business for A -->
        </perform>
        <perform name="creditForB"
            choreographyName="CoordinatedCreditAuthorization" 
             choreographyInstance="creditForB">choreographyInstanceId="'creditForB'">
            <!-- bind such that this does the business for  AB -->
        </perform>
    </parallel>
        
    <!--  other stuff here -->
    
    <workunit name="chooseA"
         guard="cdl:getVariable(,Chosen,,,,,Broker,)=,A,"guard="cdl:getVariable('Chosen','','','Broker')='A'" >
         <finalize> <finalizerReference<finalize choreographyName="CoordinatedCreditAuthorization"
                 choreographyInstanceId="creditForA"choreographyInstanceId="'creditForA'"
                finalizerName="drawDown"/>
         <finalizerReference<finalize choreographyName="CoordinatedCreditAuthorization"
                 choreographyInstanceId="creditForB"choreographyInstanceId="'creditForB'"
                finalizerName="replenish"/>
     </finalize></workunit>            

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

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


</choreography>

3 Example To be completed. 4 Relationship7 Interoperability with other Specifications

7.1 Interoperability with theSecurity framework Theframeworks

Security specifications, such as WS-Security specification[WSS ] provides], 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 partiesparticipants will impose security requirements on their information exchanges. WS-Security and other security specifications can be used satisfy many of these requirements.

5 Relationship withA 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 framework Theframeworks

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

A violation of any of these consistency guarantees results in an "error","errors" which MAY be reflected in the Choreography with an Exception. 6 Relationshipchoreography as exceptions, identified by different "QNames".

7.3 Interoperability with theCoordination frameworkframeworks

In WS-CDL, Alignment Interactionsalignment interactions and Coordinated Choreographiescoordinated choreographies require support from a Coordinationcoordination protocol, where agreement on the outcome among partiesparticipants can be reached even in the case of failures and loss of messages. In this case, the Alignment Interactionsalignment interactions and the Coordinated Choreographiescoordinated choreographies MUST be bound to a Coordinationcoordination protocol.

7 Relationship7.4 Interoperability with theAddressing framework The WS-Addressing specificationframeworks

Web Services Addressing [WSAD] provides transport-neutral mechanisms to address Web services and messages, specifically,messages. Web Services Addressing 1.0 - Core defines a set of abstract properties and an XML Infoset [XML], [XMLNS] elementsrepresentation thereof to identify Web service endpoints and to securefacilitate end-to-end endpointidentification of endpoints in messages. WS-AddressingThe 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 Variablechannel variable information into ana 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 inof this effort on an ongoing basis. 8 Conformance To be completedongoing 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 (Enigmatec Corporation).(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 (webMethods, Inc.),(Adobe Systems, Inc), Carine Bournez (W3C), Gary Brown (Enigmatec(Pi4 Technologies Ltd), Ugo Corda (SeeBeyond Technology Corporation), Anthony Fletcher (Choreology Ltd), Peter Furniss (Choreology Ltd), Jim Hendler (University of Maryland (Mind Lab)),Kohei Honda (Queen Mary and Westerfield College), NickolasDuncan Johnston-Watt (Enigmatec Corporation), Nickolas Kavantzas (Oracle Corporation), Yutaka Kudou (Hitachi, Ltd.),Yves Lafon (W3C), Monica Martin (Sun Microsystems, Inc.), Robin Milner (Cambridge University), Jeff Mischkinsky (Oracle Corporation), Bijan Parsia (University of Maryland (Mind Lab)),Greg Ritzinger (Novell), Yoko Seki (Hitachi, Ltd.), Prasad Yendluri (webMethods, Inc.),Nobuko Yoshida (Imperial College London). Previous members of the Working Group were: Assaf Arkin (Intalio Inc.), Daniel Austin (Sun Microsystems, 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), Ugo Corda (SeeBeyond Technology Corporation),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), Duncan Johnston-Watt (Enigmatec Corporation),Eunju Kim (National Computerization Agency), Mayilraj Krishnan (Cisco Systems Inc.), Melanie Kudela (Uniform Code Council), Yutaka Kudou (Hitachi, Ltd.), Bruno Kurtic (webMethods, Inc.),Inc.),  Paul Lipton (Computer Associates), Kevin Liu (SAP AG), Francis McCabe (Fujitsu Ltd.),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.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 RFCversion is http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The latest version is available at http://www.ietf.org/rfc/rfc2119.txt. RFC 2396 Uniform Resource Identifiers (URI): Generic Syntaxhttp://www.w3.org/TR/xmlschema-1/.
XML Schema Part 2: Datatypes Second Edition
XML Schema Part 2: Datatypes Second Edition, T. Berners-Lee, R. FieldingAshok Malhotra and L. Masinter,Paul V. Biron, Editors. IETF, August 1998.World Wide Web Consortium, 28 October 2004. This RFCversion is http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/. The latest version is available at http://www.ietf.org/rfc/rfc2396.txt. SOAP Version 1.2 Part 1: Messaginghttp://www.w3.org/TR/xmlschema-2/.
XPointer Framework
SOAP Version 1.2 Part 1: MessagingXPointer Framework, Marc Hadley, Noah Mendelsohn, Jean-Jacques Moreau, et. al.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, 24 June 2003.20 December 2004. This version is http://www.w3.org/TR/2003/REC-soap12-part1-20030624/.http://www.w3.org/TR/2004/REC-xinclude-20041220/. The latest version is available at http://www.w3.org/TR/soap12-part1/.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 2004.2005. This version is http://www.w3.org/TR/2004/WD-wsdl20-20040803.http://www.w3.org/TR/2005/WD-wsdl20-20050803. The latest version is available at http://www.w3.org/TR/wsdl20.
UDDI v3 UDDIBasic Profile
Basic Profile 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 Extensible Markup Language (XML) 1.0 (Third Edition) Extensible Markup Language (XML) 1.0 (Third Edition) , Jean Paoli, Eve Maler, Tim Bray, et. al.1.1, 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. Namespaces in XML Namespaces in XMLKeith Ballinger, David Ehnebuske, Christopher Ferris et. al., Andrew Layman, Dave Hollander, and Tim Bray,Editors. World WideThe Web Consortium, 14 January 1999.Services-Interoperability Organization, 24 September 2004. This version is http://www.w3.org/TR/1999/REC-xml-names-19990114.http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html. The latest version is available at http://www.w3.org/TR/REC-xml-names. XML Schemahttp://www.ws-i.org/Profiles/BasicProfile-1.1.html.

10.2 Informative References

SOAP Version 1.2 Part 1: Structures Second Edition XML SchemaMessaging Framework
SOAP Version 1.2 Part 1: Structures Second EditionMessaging Framework, David Beech, Murray Maloney, Henry S. Thompson, andMarc Hadley, Noah Mendelsohn, Jean-Jacques Moreau, et. al., Editors. World Wide Web Consortium, 28 October 2004.24 June 2003. This version is http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/.http://www.w3.org/TR/2003/REC-soap12-part1-20030624/. The latest version is available at http://www.w3.org/TR/xmlschema-1/.http://www.w3.org/TR/soap12-part1/.
Processing XML 1.1 documents with XML Schema Part 2: Datatypes Second Edition1.0 processors
Processing XML 1.1 documents with XML Schema Part 2: Datatypes Second Edition1.0 processors, Ashok Malhotra and Paul V. Biron, Editors.Henry S. Thompson , Editor. World Wide Web Consortium, 28 October 2004.11 May 2005. This version is http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/.http://www.w3.org/TR/2005/NOTE-xml11schema10-20050511/. The latest version is available at http://www.w3.org/TR/xmlschema-2/. XPointer Framework XPointer Frameworkhttp://www.w3.org/TR/xml11schema10.
UDDI v3
UDDI Version 3.0.2, Paul Grosso, Eve Maler, Jonathan Marsh, and Norman Walsh,Luc Clement, Andrew Hately, Claus von Riegen, Tony Rogers, Editors. World Wide Web Consortium, 25 March 2003.OASIS Open, 19 October 2004. This version is http://www.w3.org/TR/2003/REC-xptr-framework-20030325/.http://uddi.org/pubs/uddi-v3.0.2-20041019.htm. The latest version is available at http://www.w3.org/TR/xptr-framework/.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 href="http://www.w3.org/TR/2002/NOTE-wsci-20020808.http://www.w3.org/TR/2002/NOTE-wsci-20020808. The latest version is available at href="http://www.w3.org/TR/2002/NOTE-wsci-20020808.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/.
XML Inclusions (XInclude) Version 1.0 XML Inclusions (XInclude) Version 1.0 , Jonathan Marsh and David Orchard, Editors. World Wide Web Consortium, 30 September 2004. This version is http://www.w3.org/TR/2004/PR-xinclude-20040930/. The latest version is available at http://www.w3.org/TR/xinclude/.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, 08 December17 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/WD-ws-addr-core-20041208/. The latest versionhttp://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.w3.org/TR/ws-addr-core.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 Last Call Issues 11.1 Issue 1 DueMay 2001. This version is http://www.ebxml.org/specs/ebBPSS.pdf.

A Mime Type definition

MIME media type name:

application

MIME subtype name:

cdl+xml

Required parameters:

none

Optional parameters:
charset

This parameter has identical semantics to a lackthe charset parameter of the "application/xml" media type as specified in RFC 3023 [RFC 3023].

Encoding considerations:

Identical to those of clarity"application/xml" as described in existing XML specifications,RFC 3023 [RFC 3023], section 3.2.

Security considerations:

WS-CDL has the WS-Choreography Working Group is unable atsame security considerations described in RFC3023 [RFC 3023], section 10.

Interoperability considerations:

There are no known interoperability issues.

Published specification:

This document

Applications which use this timemedia type:

No known applications currently use this media type.

Additional information:
File extension:

CDL

Fragment identifiers:

Identical to recommend an approach for accessing and modifying membersthat of lists"application/xml" as described in RFC 3023 [RFC 3023], section 5.

Base URI:

As specified in RFC 3023 [RFC 3023], section 6.

Macintosh File Type code:

TEXT

Person and arrays. 11.2 Issue 2 The WS-Choreography Working Group is working on a proposalemail address to contact for extending Choreographies (thatfurther information:

Yves Lafon <ylafon@w3.org>

Intended usage:

COMMON

Author/Change controller:

The WS-CDL 1.0 specification is specifyinga choreography by defining how it is based on another choreography). Thiswork is not finalized asproduct of yet, but we do not believe it will have a major impact onthe architecture. 12World Wide Web Consortium's http://www.w3.org/2002/ws/chor/. The W3C has change control over this specification.

B WS-CDL XSD Schemas

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
     xmlns:cdl="http://www.w3.org/2004/12/ws-chor/cdl" targetNamespace="http://www.w3.org/2004/12/ws-chor/cdl"xmlns:cdl="http://www.w3.org/2005/10/cdl"
    targetNamespace="http://www.w3.org/2005/10/cdl"
    elementFormDefault="qualified">

  <complexType name="tExtensibleElements">
    <annotation>
      <documentation>
        This type is extended by other  CDLWS-CDL component types to allow 
          elements and attributes from other namespaces to be added. 
        This type also contains the optional description element that 
        is applied to all  CDLWS-CDL constructs.
       </documentation>
    </annotation>
    <sequence>
      <element name="description" minOccurs="0">
        <complexType mixed="true">
          <sequence minOccurs="0" maxOccurs="unbounded">
            <any processContents="lax"/>
          </sequence>
          <attribute name="type" type="cdl:tDescriptionType" use="optional" 
                 default="documentation"/>
        </complexType>
      </element>
       <any namespace="##other" processContents="lax"<element name="CDLExtension" minOccurs="0"  maxOccurs="unbounded"/>maxOccurs="unbounded">
        <complexType>
          <sequence minOccurs="0" maxOccurs="unbounded">
            <any processContents="lax"/>
          </sequence>
        </complexType>
      </element>
    </sequence>
    <anyAttribute namespace="##other" processContents="lax"/>
  </complexType>

    <element name="package" type="cdl:tPackage"/>
    
  <complexType name="tPackage">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="informationType" type="cdl:tInformationType" 
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="token" type="cdl:tToken" minOccurs="0"
                  maxOccurs="unbounded"/>
          <element name="tokenLocator" type="cdl:tTokenLocator" 
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="roleType" type="cdl:tRoleType" minOccurs="0"
                  maxOccurs="unbounded"/>
          <element name="relationshipType" type="cdl:tRelationshipType" 
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="participantType" type="cdl:tParticipantType" 
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="channelType" type="cdl:tChannelType"
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="choreography" type="cdl:tChoreography" 
                  minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="author" type="string" use="optional"/>
        <attribute name="version" type="string" use="optional"/>
        <attribute name="targetNamespace" type="anyURI" 
                 use="required"/>
      </extension>
    </complexContent>
  </complexType>
    
  <complexType name="tInformationType">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="type" type="QName" use="optional"/>
        <attribute name="element" type="QName" use="optional"/>
       <attribute name="exceptionType" type="boolean" use="optional" default="false" /></extension>
    </complexContent>
  </complexType>

  <complexType name="tToken">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="informationType" type="QName"
                 use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tTokenLocator">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="tokenName" type="QName" use="required"/>
        <attribute name="informationType" type="QName"
                 use="required"/>
        <attribute name="part" type="NCName" use="optional" />
        <attribute name="query" type="cdl:tXPath-expr" 
                 use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRoleType">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="behavior" type="cdl:tBehavior"
                  maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tBehavior">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="interface" type="QName" use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRelationshipType">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element  name="role"name="roleType" type="cdl:tRoleRef" minOccurs="2"
                  maxOccurs="2"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRoleRef">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute  name="type"name="typeRef" type="QName" use="required"/>
        <attribute name="behavior" use="optional">
          <simpleType>
             <list itemType="NCName"/>
          </simpleType>
        </attribute>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tParticipantType">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element  name="role"name="roleType" type="cdl:tRoleRef2" 
                  maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRoleRef2">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute  name="type"name="typeRef" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tChannelType">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="passing" type="cdl:tPassing" minOccurs="0"
                  maxOccurs="unbounded"/>
          <element  name="role"name="roleType" type="cdl:tRoleRef3"/>
          <element name="reference" type="cdl:tReference"/>
          <element name="identity" type="cdl:tIdentity" minOccurs="0" 
                   maxOccurs="1"/>maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="usage" type="cdl:tUsage" use="optional" 
                      default="unlimited"/>default="distinct"/>
        <attribute name="action" type="cdl:tAction" use="optional"
                     default="request"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRoleRef3">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute  name="type"name="typeRef" type="QName" use="required"/>
        <attribute name="behavior" type="NCName" use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tPassing">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="channel" type="QName" use="required"/>
        <attribute name="action" type="cdl:tAction" use="optional" 
                 default="request"/>
        <attribute name="new" type="boolean" use="optional"
                 default="false"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tReference">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="token" type="cdl:tTokenReference"
                      minOccurs="1" maxOccurs="1"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tTokenReference">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="name" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tIdentity">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="token" type="cdl:tTokenReference" 
                  minOccurs="1" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="usage" type="cdl:tUsageI" use="optional" 
                     default="primary"/>
      </extension>
    </complexContent>
  </complexType>


  <complexType name="tChoreography">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="relationship" type="cdl:tRelationshipRef" 
                  maxOccurs="unbounded"/>
          <element name="variableDefinitions"
                  type="cdl:tVariableDefinitions" minOccurs="0"/>
          <element name="choreography" type="cdl:tChoreography"
                   minOccurs="0" maxOccurs="unbounded"/>
          <group ref="cdl:activity"/>
          <element name="exceptionBlock" type="cdl:tException"
                  minOccurs="0"/>
          <element name="finalizerBlock" type="cdl:tFinalizer"
                      minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="complete" type="cdl:tBoolean-expr" 
                     use="optional"/>
        <attribute name="isolation" type="boolean" 
                     use="optional" default="false"/>
        <attribute name="root" type="boolean" use="optional" 
                     default="false"/>
        <attribute name="coordination" type="boolean" use="optional" 
                     default="false"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRelationshipRef">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="type" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tVariableDefinitions">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="variable" type="cdl:tVariable"
                  maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tVariable">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="informationType" type="QName" 
                 use="optional"/>
        <attribute name="channelType" type="QName" use="optional"/>
        <attribute name="mutable" type="boolean" use="optional"
                 default="true"/>
        <attribute name="free" type="boolean" use="optional" 
                 default="false"/>
        <attribute name="silent" type="boolean" use="optional"
                 default="false"/>
        <attribute name="roleTypes" use="optional">
           <simpleType>
              <list itemType="QName"/>
           </simpleType>
        </attribute>
      </extension>
    </complexContent>
  </complexType>

  <group name="activity">
    <choice>
      <element name="sequence" type="cdl:tSequence"/>
      <element name="parallel" type="cdl:tParallel"/>
      <element name="choice" type="cdl:tChoice"/>
      <element name="workunit" type="cdl:tWorkunit"/>
      <element name="interaction" type="cdl:tInteraction"/>
      <element name="perform" type="cdl:tPerform"/>
      <element name="assign" type="cdl:tAssign"/>
      <element name="silentAction" type="cdl:tSilentAction"/>
      <element name="noAction" type="cdl:tNoAction"/>
      <element name="finalize" type="cdl:tFinalize"/>
      <any namespace="##other" processContents="lax"/>
    </choice>
  </group>

  <complexType name="tSequence">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <group ref="cdl:activity" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tParallel">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <group ref="cdl:activity" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tChoice">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <group ref="cdl:activity" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tWorkunit">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <group ref="cdl:activity"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="guard" type="cdl:tBoolean-expr" 
                 use="optional"/>
        <attribute name="repeat" type="cdl:tBoolean-expr" 
                 use="optional"/>
        <attribute name="block" type="boolean" 
                 use="optional" default="false"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tPerform">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="bind" type="cdl:tBind" 
                  minOccurs="0" maxOccurs="unbounded"/>
          <element name="choreography" type="cdl:tChoreography"
                   minOccurs="0" maxOccurs="1"/>
        </sequence>
        <attribute name="choreographyName" type="QName" use="required"/>
        <attribute name="choreographyInstanceId" type="cdl:tXPath-expr" use="optional"/>
        <attribute name="block" type="boolean" 
                 use="optional" default="true"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tBind">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="this" type="cdl:tBindVariable"/>
          <element name="free" type="cdl:tBindVariable"/>
        </sequence>
         <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tBindVariable">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="variable" type="cdl:tXPath-expr" 
                 use="required"/>
        <attribute  name="role"name="roleType" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tInteraction">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="participate" type="cdl:tParticipate"/>
          <element name="exchange" type="cdl:tExchange" minOccurs="0"
                  maxOccurs="unbounded"/>
          <element name="timeout" type="cdl:tTimeout" minOccurs="0"
                  maxOccurs="1"/>
          <element name="record" type="cdl:tRecord" minOccurs="0" 
                  maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="channelVariable" type="QName" 
                 use="required"/>
        <attribute name="operation" type="NCName" use="required"/>
        <attribute name="align" type="boolean" use="optional" 
                 default="false"/>
        <attribute name="initiate" type="boolean" 
                 use="optional" default="false"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tTimeout">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="time-to-complete" type="cdl:tXPath-expr" use="required"/>
        <attribute  name="fromRoleRecordReference"name="fromRoleTypeRecordRef" use="optional">
          <simpleType>
             <list itemType="NCName"/>
          </simpleType>
        </attribute>
        <attribute  name="toRoleRecordReference"name="toRoleTypeRecordRef" use="optional">
          <simpleType>
             <list itemType="NCName"/>
          </simpleType>
        </attribute>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tParticipate">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="relationshipType" type="QName" use="required"/>
        <attribute  name="fromRole"name="fromRoleTypeRef" type="QName" use="required"/>
        <attribute  name="toRole"name="toRoleTypeRef" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tExchange">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="send" type="cdl:tVariableRecordRef"/>
          <element name="receive" type="cdl:tVariableRecordRef"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="faultName" type="QName" 
                 use="optional"/>
        <attribute name="informationType" type="QName" 
                 use="optional"/>
        <attribute name="channelType" type="QName" 
                 use="optional"/>
        <attribute name="action" type="cdl:tAction2" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tVariableRecordRef">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="variable" type="cdl:tXPath-expr" 
                use="optional"/>
        <attribute name="recordReference" use="optional">
          <simpleType>
             <list itemType="NCName"/>
          </simpleType>
        </attribute>
        <attribute name="causeException"  type="boolean"type="QName" 
                use="optional"  default="false"/>/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tRecord">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="source" type="cdl:tSourceVariableRef"/>
          <element name="target" type="cdl:tVariableRef"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="causeException"  type="boolean"type="QName" use="optional"  default="false"/>/>
        <attribute name="when" type="cdl:tWhenType" use="required"/>
      </extension>
    </complexContent>
  </complexType>

   <complexType name="tSourceVariableRef">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="variable" type="cdl:tXPath-expr" 
                use="optional"/>
        <attribute name="expression" type="cdl:tXPath-expr" 
                use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tVariableRef">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="variable" type="cdl:tXPath-expr" 
                use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tAssign">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
      <element name="copy" type="cdl:tCopy"
               maxOccurs="unbounded"/>
        </sequence>
        <attribute name="roleType" type="QName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tCopy">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="source" type="cdl:tSourceVariableRef"/>
          <element name="target" type="cdl:tVariableRef"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
        <attribute name="causeException"  type="boolean"type="QName" 
                use="optional"  default="false"/>/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tSilentAction">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="roleType" type="QName" use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tNoAction">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <attribute name="roleType" type="QName" use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tFinalize">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
         <sequence> <element name="finalizerReference" type="cdl:tFinalizerReference" maxOccurs="unbounded"/> </sequence><attribute name="name" type="NCName" use="required"/>
         </extension> </complexContent> </complexType> <complexType name="tFinalizerReference"> <complexContent> <extension base="cdl:tExtensibleElements"><attribute name="choreographyName" type="NCName" use="required"/>
        <attribute name="choreographyInstanceId" type="cdl:tXPath-expr"
                                                      use="optional"/>
        <attribute name="finalizerName" type="NCName" use="optional"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tException">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
          <element name="workunit" type="cdl:tWorkunit"
                  maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="tFinalizer">
    <complexContent>
      <extension base="cdl:tExtensibleElements">
        <sequence>
           <element name="workunit" type="cdl:tWorkunit"/><group ref="cdl:activity"/>
        </sequence>
        <attribute name="name" type="NCName" use="required"/>
      </extension>
    </complexContent>
  </complexType>

  <simpleType name="tAction">
    <restriction base="string">
      <enumeration value="request-respond"/>
      <enumeration value="request"/>
      <enumeration value="respond"/>
    </restriction>
  </simpleType>

  <simpleType name="tAction2">
    <restriction base="string">
      <enumeration value="request"/>
      <enumeration value="respond"/>
    </restriction>
  </simpleType>

  <simpleType name="tUsage">
    <restriction base="string">
      <enumeration value="once"/>
      <enumeration  value="unlimited"/>value="distinct"/>
      <enumeration value="shared"/>
    </restriction>
  </simpleType>

  <simpleType name="tUsageI">
    <restriction base="string">
      <enumeration value="primary"/>
      <enumeration value="alternate"/>
      <enumeration value="derived"/>
      <enumeration value="association"/>
    </restriction>
  </simpleType>

  <simpleType name="tWhenType">
    <restriction base="string">
      <enumeration value="before"/>
      <enumeration value="after"/>
      <enumeration value="timeout"/>
    </restriction>
  </simpleType>


  <simpleType name="tBoolean-expr">
    <restriction base="string"/>
  </simpleType>

  <simpleType name="tXPath-expr">
    <restriction base="string"/>
  </simpleType>

  <simpleType name="tDescriptionType">
    <restriction base="string">
      <enumeration value="documentation"/>
      <enumeration value="reference"/>
      <enumeration value="semantics"/>
    </restriction>
  </simpleType>

</schema>