W3C home > Mailing lists > Public > public-ws-chor@w3.org > December 2004

FW: WS-CDL v1, last call doc (dec 8, 2004)

From: Tony Fletcher <tony_fletcher@btopenworld.com>
Date: Fri, 10 Dec 2004 16:51:53 -0000
To: <public-ws-chor@w3.org>
Message-ID: <001e01c4ded8$8d976cf0$6701a8c0@corp.choreology.com>
Dear Colleagues,
 
Sorry, found what I think is another typo in the Example 1 and 2 in Section
2.4.10 Choreography Coordination.  Yes happy to lick the egg of my face as
this is in one of the parts we contributed!!  Corrected bits highlighted in
red in the second version of the code examples  (I have left the first
uncorrected version in so people can work out the change if viewing a text
rather than an HTML version of this message.  Change is to the
informationType of creditAuthorized  and creditDenied
 
 
 

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

 

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

 

<!-- Coordinated CreditAuthorization  choreography without Finalizer
Block(s)-->

<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"/>

      <exchange name="creditRequest" informationType="creditRequest" 

                action="request">

         <send variable="tns:creditRequest"/>

         <receive variable="tns:creditRequest"/>

      </exchange>

      <exchange name="creditAuthorized" informationType="creditDenied"   

                action="respond">

         <send variable="tns:creditAuthorized"/>

         <receive variable="tns:creditAuthorized"/>

      </exchange>

      <exchange name="creditDenied" informationType="refusal"
action="respond">

         <send variable="tns:creditDenied" causeException="true"/>

         <receive variable="tns:creditDenied" causeException="true"/>

      </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"/>

      </interaction>

     </workunit>

  </exceptionBlock>

</choreography>

 

 

Example 2: Coordinated credit authorization with Finalizer Block(s):

 

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

 

<!-- Coordinated CreditAuthorization  choreography with Finalizer Block(s)
-->

<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"/>

      <exchange name="creditRequest" informationType="creditRequest"  

             action="request">

         <send variable="tns:creditRequest"/>

         <receive variable="tns:creditRequest"/>

      </exchange>

      <exchange name="creditAuthorized" informationType="creditDenied" 

                action="respond">

         <send variable="tns:creditAuthorized"/>

         <receive variable="tns:creditAuthorized"/>

      </exchange>

      <exchange name="creditDenied" informationType="refusal"
action="respond">

         <send variable="tns:creditDenied" causeException="true"/>

         <receive variable="tns:creditDenied" causeException="true"/>

      </exchange>

   </interaction>

 

   <!-- catch the (application) exception - as an exception it will abort
the 

        choreography and the Finalizer Block(s) 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"/>

          </interaction>

       </workunit>

   </exceptionBlock>

 

   <!-- Finalizer Block(s) -->

   <!-- 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"/>

                  <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"/>

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

 
 
Now my corrections
 

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

 

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

 

<!-- Coordinated CreditAuthorization  choreography without Finalizer
Block(s)-->

<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"/>

      <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"/>

         <receive variable="tns:creditDenied" causeException="true"/>

      </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"/>

      </interaction>

     </workunit>

  </exceptionBlock>

</choreography>

 

 

Example 2: Coordinated credit authorization with Finalizer Block(s):

 

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

 

<!-- Coordinated CreditAuthorization  choreography with Finalizer Block(s)
-->

<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"/>

      <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"/>

         <receive variable="tns:creditDenied" causeException="true"/>

      </exchange>

   </interaction>

 

   <!-- catch the (application) exception - as an exception it will abort
the 

        choreography and the Finalizer Block(s) 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"/>

          </interaction>

       </workunit>

   </exceptionBlock>

 

   <!-- Finalizer Block(s) -->

   <!-- 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"/>

                  <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"/>

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

 
 
 
 Best Regards     Tony
A M Fletcher
 
Cohesions  (TM)
 
Business transaction management software for application coordination
<http://www.choreology.com/> www.choreology.com
 
Choreology Ltd., 68 Lombard Street, London EC3V 9LJ     UK
Tel: +44 (0) 1473 729537   Mobile: +44 (0) 7801 948219
 <mailto:tony.fletcher@choreology.com> tony.fletcher@choreology.com
(Home:  <mailto:amfletcher@iee.org> amfletcher@iee.org)
 
Received on Friday, 10 December 2004 16:52:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 01:01:15 GMT