revised finalize text ("proposal 4")

The Finalize activity is used to enable a finalizer in 
completed instances of immediately enclosed choreographies, and thus
bring 
those choreographies to defined conclusions.
 
The syntax for finalize is:
 
<finalize  name="ncname"?>
    <finalizerReference 
            choreographyName="ncname"
            choreographyInstanceId="XPath-expression"? />
            finalizerName="ncname"?
    <-- extensibility element --> 
    </finalizerReference />+
</finalize>
 

A Choreography that does not perform any enclosed choreographies that
have
finalizers defined MUST NOT have any finalize elements in it. A finalize
element may 
be present in any Activity-Notation within a Choreography
that has performed an enclosed choreography with one or more defined
finalizers 
- that is a finalize element can be in the main Activity-Notation of the

 choreography body, in an Exception work unit or in a finalizer.
 
For a single performed choreography instance, at most one of its
finalizers shall be enabled by a finalize element during the subsequent
progress Including exception handling and finalization) of the enclosing
choregraphy. If the enclosing choreography
goes out of scope (i.e. completes with no finalizers of its own
installed or after
its finalization) and no finalizer of the enclosed choreography has been
explicitly enabled, the enclosed choreography is closed without
finalization.
 

The attribute name is used for specifying a distinct name for each
finalize element declared within a Choreography Package.
 
Each finalizerReference element enables a finalizer in an performed
instance of an enclosed choreography. Within a finalize element, each
finalizerReference
MUST refer to a different performed instance.
 
Within the finalizerReference element, the choreographyName attribute
identifies 
the Locally or Globally defined Choreography referenced by the
choreographyName
attribute of the perform construct.
 
Within the finalizerReference element, the optional
choreographyInstanceId
attribute identifies the performed choreography instance to be
finalized, using
the value defined by the choreographyInstanceId attribute of the perform
construct.
The choreographyInstanceId attribute MAY be omitted if the logic of the
enclosing 
choreography is such that only one instance of the 
choreography identified by the choreographyName attribute can have been
performed
when the finalize element is enabled. If more than one instance of the
choreography
identified by the choregraphyName attribute can have been performed, the
choreographyInstanceId
attribute MUST be present.
 
Within the finalizerReference element, the attribute finalizerName
indicates
which finalizer is to be enabled in the
performed instance. If the target enclosed choreography has only one
defined
finalizer, finalizerName is optional. 
 

--
Example:
 
<choreography name="CreditDecider" root="true">
 
    <!-- only a snippet shown -->
    <sequence>
    
        <!--  other stuff here -->
        <parallel>
            <perform name="creditForA"
choreographyName="CoordinatedCreditAuthorization">
                <!-- bind such that this does the business for A -->
            </perform>
            <perform name="creditForB"
choreographyName="CoordinatedCreditAuthorization">
                <!-- bind such that this does the business for A -->
            </perform>
        </parallel>
        
        <!--  other stuff here -->
    
        <choice>
            <!-- choice is shown as unobservable - explict workunits
would be possible -->
            <!--  events have occurred such that A is chosen -->
            <finalize>
                <finalizerReference choreographyName="creditForA"
finalizerName="drawDown"/>
                <finalizerReference choreographyName="creditForB"
finalizerName="replenish"/>
            </finalize>
            
            
            <!--  events have occurred such that B  is chosen  -->
            <finalize>
                <finalizerReference choreographyName="creditForA"
finalizerName="replenish"/>
                <finalizerReference choreographyName="creditForB"
finalizerName="drawDown"/>
            </finalize>
            
 
            <!--  events have occurred such that neither is chosen -->
            <finalize>
                <finalizerReference choreographyName="creditForA"
finalizerName="replenish"/>
                <finalizerReference choreographyName="creditForB"
finalizerName="replenish"/>
            </finalize>
            
        </choice>
      
    </sequence>
 
</choreography>
 

---
<complexType name="tFinalize">
    <complexContent>
        <extension base="cdl:tExtensibleElements">
            <sequence>
                <element name="finalizerReference"
type="cdl:tFinalizerReference" minOccurs="1" maxOccurs="unbounded">
            </sequence>
            <attribute name="name" type="NCName" use="optional"/>
        </extension>
    </complexContent>
</complexType>
 
<complexType name="tFinalizeReference">
    <complexContent>
        <extension base="cdl:tExtensibleElements">
            <attribute name="choreographyName" type="QName"
use="required"/>
            <attribute name="choreographyInstanceId" type="XPath-expr"
use="optional"/>
            <attribute name="finalizerName" type="NCname"
use="optional"/>
        </extension>
    </complexContent>
</complexType>
 
 
 
Peter
 
------------------------------------------
Peter Furniss
Chief Scientist, Choreology Ltd
web: http://www.choreology.com <http://www.choreology.com/> 
email: peter.furniss@choreology.com
phone: +44 870 739 0066
mobile: +44 7951 536168

 
Choreology Anti virus scan completed

Received on Friday, 19 November 2004 16:57:35 UTC