Possibly improved example for coordination proposal 4, finalize activity

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

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

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


Choreology Anti virus scan completed

Received on Tuesday, 23 November 2004 23:13:31 UTC