Terminating the execution path

Each execution path in an activity diagram must terminate in either success or failure.

Terminating in success

Ending the collaboration in success means that the execution path for the activity diagram successfully handled the triggering event. Either all the execution was successful or, if an exception occurred, the activity diagram handled it in a way that still allowed the collaboration to end in success. For more information, see Handling exceptions.

To indicate successful termination, place the End Success symbol at the end of the execution path. When the collaboration runtime environment executes the End Success, it terminates the current execution path and passes control to the next higher level of execution (the parent diagram), if one exists. When a subdiagram or iterator reaches an End Success node, control passes to the parent diagram. When the main activity diagram reaches an End Success node, control passes to the collaboration runtime environment, which performs its own error-handling actions.

Adding the End Success symbol

To terminate an execution path in success, place an End Success symbol in the activity diagram and connect it. To add an End Success symbol to an

activity diagram:

  1. In the Diagram Symbols toolbar, click the End Success button.
  2. Click in the workspace to place the End Success symbol.

Defining the End Success symbol

After the End Success symbol appears in the activity diagram, you can define its properties in the End Success Properties dialog. The properties of an End Success symbol are its label and description. Both are optional.

To define End Success properties:

  1. Display the End Success Properties dialog.

    You can display this dialog in any of the following ways:

    The End Success Properties dialog displays.

  2. Optionally, specify the label and description for this action node.

    The label makes the activity diagram more readable, by labeling the End Success symbol with text that is more descriptive than the UID. The description field is a place for a comment, which describes the purpose of the End Success symbol.

  3. Click Apply to save the End Success properties. Click Discard to clear the properties. Click Close to cancel this End Success definition.

Terminating in failure

Ending the collaboration in failure means that the activity diagram was unable to execute properly and execution must stop. To indicate unsuccessful termination, place the End Failure symbol at the end of the execution path. When the collaboration runtime environment executes the End Failure, it terminates the entire collaboration. When a subdiagram or iterator reaches an End Failure node, both the subdiagram or iterator terminates as well as all parent diagrams terminate. The collaboration runtime environment then performs its own error-handling actions.

Note:
Reaching an End Failure symbol always stops execution of the collaboration. However, ending in End Failure does not automatically fail the triggering event. Only if the collaboration's execution is in the Exception state does the collaboration runtime environment create an unresolved flow for the triggering event. For more information, see Handling exceptions.

Adding the End Failure symbol

To terminate an execution path in failure, place an End Failure symbol in the activity diagram and connect it. To add an End Failure symbol to an

activity diagram:

  1. In the Diagram Symbols toolbar, click the End Failure button.
  2. Click in the workspace to place the End Failure symbol.

Defining the End Failure symbol

After the End Failure symbol appears in the activity diagram, you can define its properties in the End Failure Properties dialog. The properties of an End Failure symbol are its label and description. Both are optional.

To define End Failure properties:

  1. Display the End Failure Properties dialog.

    You can display this dialog in any of the following ways:

  2. Optionally, specify the label and description for this action node.

    The label makes the activity diagram more readable, by labeling the End Failure symbol with text that is more descriptive than the UID. The description field is a place for a comment, which describes the purpose of the End Failure symbol.

  3. Click Apply to save the End Failure properties. Click Discard to clear the properties. Click Close to cancel this End Failure definition.

Copyright IBM Corp. 2003, 2004