WS Choreography, Ideas for Implementing Choreography Templates - Version 2

0. Update

I (David B) have reviewed the original, June 18, 2004 version of this note with Nick Kavantzas. He raised the following points:

  1. Use of parameter References. This should not be necessary as you should only have one way of Import stuff. Need to work out how to use Import for this purpose
  2. Overriding parameter values. Overriding one parameter value with another value defined later should not be allowed, and should cause an error instead. This will simplify handling of the parameter values.
  3. Replacing Parameter Values. The value in a ParameterValue element cannot be the name of another Parameter Value, as this will complicate the approach.
  4. Text as well as name substitution. Currently, parameter values can substitue one ncname for another. This is too simple, you also want to be able substitute element content.

I agree with these points so have updated the rest of the note to reflect these points as well as added further clarification in several places.

David
June 30, 2004

1 Introduction

This note presents ideas for how Choreography Templates might be implemented as a follow on from the WS Choreography F2F on May 11-13, 2004 at Oracle and a discussion with Nick Kavantzas on June 30, 2004

The purpose of the note is to seek agreement on how templates could work. Once (if) agreement is reached then necessary changes to the CDL spec can be worked out.

"Choreography Templates" are choreography definitions where all the parts of the choreography definition are identified, but some have not been specified. This means that, in order to fully define a choreography based on a template, it is necessary to:

2 Requirements

At a high level, the requirements are as follows:

  1. Enable choreography re-use. Provide a text substitution mechanism for replacing various parts of a choreography definition.
  2. Control where substitutions are made. This means that the places within a choreography where substitution can occur is limited to a specific list of places. These places need to be fully defined, but include:
    1. Choreography End Point definitions
    2. Message Definitions
    3. Guard Conditions
    4. etc.
  3. Specify complete choreography definitions only. Only text substitution is allowed. Additional parts of the choreography cannot be omitted, as in the original "Package Binding" proposal, and later "extended". This means that parameters must be defined in a template choreography whenever alternative values may be used.
  4. The scope of variation in a template choreography can be controlled. This follows on from the previous requirement as a choreography designer can define a template that specifies exactly where and when the choreography may vary by varying the degree of parameterization.
  5. Use of templates is optional. This means that it should be possible to define a choreography fully without using a template
  6. Multiple sources for template parameters. Parameters to substitute in a template can come from multiple sources, specifically: the original choreography designer and each of the participants in the choreography. For example, the Buyer and Seller in a purchasing choreography would each specify their own WSDL interface(s) for the messages they each receive.

3 How it could be implemented …

This covers:

3.1 Defining a Choreography Template

The basic idea is to build on the package definition in the existing spec but add a templateParameterDefinitions element after the package element that enables substitution of values based on ncNames. For example:

<package name="ConsumerRetailerChoreoTemplate" version="1.0">
  <templateParameterDefinitions>
    <parameter name="tns:OrderMsg"/>
    <parameter name="tns:OrderAckMsg">"pons:PurchaseOrderAckMsg"</parameter>
    <parameter name="tns:RetailerInfo">
        ...
  </templateParameterDefinitions>
  ...
  <informationType name="purchaseOrderType" type="tns:OrderMsg"/>
  <informationType name="purchaseOrderAckType" type="tns:OrderAckMsg"/>
  ...
  <someElement>tns:RetailerInfo</someElement>
  ...
</package>

The basic idea is that:

Notes.

  1. The optional default value for a template parameter must be used if, when the template is referenced, no substitute value is provided.
  2. The element someElement is not in the current CDL spec. It has been included here to show how you can substitute any content, including, if necessary XML - see the next topic.

3.2 Using a Choreography Template

A package definition that is based on a template contains:

For example the template defined in section 3.1 could be used as follows:

<package name="MyConsumerRetailerChoreo" version="1.0">
  <templateParameterValues template="ConsumerRetailerChoreoTemplate" templateVersion="1.0">
    <parameterValue name="tns:OrderMsg>"pons:PurchaseOrderMsg"</parameterValue>
    <parameterValue name="tns:RetailerInfo>"<someXMLorOtherText>...</someXMLorOtherText>"</parameterValue>
    ...
  </templateParameterValues>
  ...
</package>

Notes.

3.3 Combining Both

A Package definition may contain both templateParameterDefinitions and templateParameterValues elements. For example:

<package name="ConsumerPurchasingChoreoTemplate" version="1.0">
  <templateParameterDefinitions>
    ...
  </templateParameterDefinitions>
  <templateParameterValues template="ConsumerRetailerChoreoTemplate" templateVersion="1.0">
    ...
  </templateParameterValues>
  <templateParameterValues template="RetailerShipperChoreoTemplate" templateVersion="1.0">
    ...
  </templateParameterValues>
  ...
  <importDefinitions>
    <import ... "ConsumerRetailerChoreoTemplate"/>
    <import ... "RetailerShipperChoreoTemplate"/>
  </importDefinitions>
  ...
</package>

Notes.

4 General Notes

Note that:

David Burdett
Commerce One
June 30, 2004