OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

wsbpel message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Issue 142 - Proposal for Vote


Proposal: Add the break and continue activities to the specification as described below.

 

-----------------------------------------------------------------------------------------

 

Add new section for basic activities (11.x)

 

11.x Continuing or Breaking from a looping container

 

Many applications require a mechanism to continue a loop at the next iteration or exit a loop altogether.  The continue and break activities provide this functionality in BPEL.

 

11.x.1 continue

 

<continue standard-attributes>

     standard-elements

</continue>

 

The continue activity starts a new iteration of the nearest enclosing while, until, or forEach activity.  When multiple while, until or forEach activities are nested within each other, a continue activity applies only to the innermost activity.

 

A continue activity is executed as follows:

 

    * Currently executing activities within the target of the continue activity are terminated.  This includes the container of the continue activity and its parents up to the root activity of the target.  If the root activity of the target is a scope then it completes normally upon termination of its child activity without running its termination handler.  This exclusion prevents child scopes which completed normally in the iteration from being inadvertently compensated at the continue point.  Note that in a forEach with the parallel option set to true (parallel forEach), the currently executing activities only apply to the current iteration's scope not the scopes of the other iterations.

    * Control is transferred to the target of the continue activity.  The target then proceeds with its next iteration processing.  Note that in a parallel forEach the iterations have already been created so this essentially notifies the forEach that this iteration has completed.

   

Because a continue statement unconditionally transfers control elsewhere, the completion point of the continue activity is never reachable.  Therefore continue activities should not be used as a source for links or directly within a sequence activity with additional activities following it.

 

11.x.2 break

 

<break standard-attributes>

     standard-elements

</continue>

 

The break activity exits the nearest enclosing while, until, or forEach activity.  When multiple while, until or forEach activities are nested within each other, a break activity applies only to the innermost activity.

 

A break activity is executed as follows:

 

    * Currently executing activities within the target of the break activity are terminated.  This includes the container of the break activity and its parents up to the root activity of the target.  If the root activity of the target is a scope then it completes normally upon termination of its child activity without running its termination handler.  This exclusion prevents child scopes which completed normally in the iteration from being inadvertently compensated at the break point.  Note that in a parallel forEach the currently executing activities apply to all currently executing iterations which process the termination in the same manner.

    * Control is transferred to the target of the break activity.  The target does not execute any further iterations and completes normally.

 

Because a break statement unconditionally transfers control elsewhere, the completion point of the break activity is never reachable.  Therefore break activities should not be used as a source for links or directly within a sequence activity with additional activities following it.

 

11.x.3 Processing N out M Results

 

One important use case which the break activity can be used to accommodate is processing N out of M results.  Many applications require mechanisms to dispatch requests to a number of partnerLinks in parallel.  As each response is received the application decides whether or not further there is a need to process further responses.  One typical example is an approval process where one might need N out of M approvers (e.g. 2 out of 3) to approve a purchase.  Once the application receives N approvals it can continue processing the purchase.  This type of processing is possible using a combination of the parallel forEach and break activities.

 

Example details to be created pending approval...

 

 

-----------------------------------------------------------------------------------------

Change section 13.4.4 Semantics of Activity Termination

 

Change the following sentences to remove the discussion of the state of the enclosing scope.

 

 "However, a termination handler cannot throw any fault. Even if an uncaught fault occurs during its behavior, it is not rethrown to the next enclosing scope. This is because the enclosing scope has already either faulted or is in the process of being terminated, which is what is causing the forced termination of the nested scope."

 

 to

 

 "However, a termination handler cannot throw any fault. Even if an uncaught fault occurs during its behavior, it is not rethrown to the next enclosing scope."

 

 

-----------------------------------------------------------------------------------------

Change schema as follows:

 

 

    Add the following types:

 

    <complexType name="tContinue">

        <complexContent>

            <extension base="bpws:tActivity"/>

        </complexContent>

    </complexType>

 

    <complexType name="tBreak">

        <complexContent>

            <extension base="bpws:tActivity"/>

        </complexContent>

    </complexType>

 

    Modify the group "activity", choice to include the following element declarations:

 

    <element name="continue" type="bpws:tContinue"/>

    <element name="break" type="bpws:tBreak"/>

 

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]