How exceptions are processed

As a collaboration executes, it can be in one of the following two execution states:

The collaboration can switch back and forth between these two states during its execution. It enters the Exception state when the exception occurs or raiseException() executes. It returns to the Normal state when the collaboration template catches the exception with an exception branch. Regardless of the exception handling that an activity diagram does (or does not) perform, the collaboration runtime environment continues execution of the diagram's logic after an exception occurs. This logic eventually ends in either an End Success or End Failure node. The collaboration runtime environment uses the collaboration's execution state to determine whether to create an unresolved flow once the collaboration ends. For more information on terminating nodes, see Terminating the execution path. For more information on unresolved flows, see Processing the Exception state.

Processing the Normal state

While the collaboration runtime environment is successfully executing a collaboration (as defined by the logic in the activity diagrams), the collaboration's execution is in the Normal state. Possible ways to end the execution path include:

Processing the Exception state

When the collaboration's execution enters the Exception state, the collaboration runtime environment does not stop execution. Instead, it continues execution as defined by the logic in the activity diagram, just as it does for execution in the Normal state. Possible ways to end this execution path include:

Successfully ending the main diagram

When the End Success node terminates the main diagram, the collaboration runtime environment ends the collaboration. If the collaboration's execution is in the Exception state, the runtime environment performs the following steps to handle the exception:

  1. Log an error to the collaboration's log destination, which can be standard output (STDOUT) or a log file, depending on how InterChange Server's log destination is configured.
  2. Create an unresolved flow for the unsuccessful collaboration.

    When a collaboration ends with its execution in the Exception state, it leaves behind an unresolved flow, which includes:

    The collaboration runtime environment sends this unresolved flow to InterChange Server's event resubmission queue, where the server administrator can analyze and assess it for possible resubmission. The Flow Manager tool provides the administrator with access to the event resubmission queue. The administrator can examine information about unresolved flows, such as the name of the collaboration that terminated and a message that describes the error condition.

    Note:
    For more information on use of the Flow Manager, see the System Administration Guide.

By default, the collaboration runtime environment associates a very simple exception message with an unresolved flow:

Scenario failed.
 

This default exception message does not provide the administrator with much information with which to troubleshoot the cause of the unresolved flow. However, if you code the collaboration template to raise the exception, you can provide an exception message with more information about the actual error condition that occurred. When the collaboration runtime environment handles the exception, it can associate this more detailed exception message with the unresolved flow. For more information, see Raising the exception.

Successfully ending a subdiagram or iterator

When the End Success node terminates a subdiagram (or iterator) and the collaboration's execution is in the Exception state, the collaboration runtime environment takes the following steps:

  1. Pass control to the parent diagram. The parent diagram is the diagram that includes the subdiagram (or iterator) node.
  2. Check for any exception branches in the parent diagram's decision node that connect the subdiagram (or iterator) with an exception-handling node. Take one of the following actions:

The collaboration runtime environment continues execution of the parent diagram's logic until that diagram terminates in either an End Success or End Failure. As long as the collaboration execution remains in the Exception state, the runtime environment handles the exception when the collaboration ends. As long as each level of execution ends with an End Success, execution passes to the next higher level until it reaches the main diagram. Unless the main diagram catches the exception, this collaboration terminates and control passes to the collaboration runtime environment.

Copyright IBM Corp. 2003, 2004