What is a collaboration exception?

The Collaboration API provides an exception object to represent an exception that occurs in a collaboration. As Figure 50 shows, this exception object contains information about the condition that caused the exception.

Figure 50. The CollaborationException exception object


This exception object is an instance of the CollaborationException class, which is an extension of the Java Exception class. Table 30 shows the accessor methods that the CollaborationException class provides to obtain information in the exception object.

Table 30.
Information in the exception object
Member Accessor method
Exception type getType()
Exception subtype getSubType()
Message text getMessage(), toString()
Message number getMsgNumber()

Note:
When an exception occurs, the collaboration runtime environment populates a system variable called currentException with information about the exception. The currentException variable is an instance of the CollaborationException class. Therefore, you can use the methods in Table 30 to obtain exception information from the currentException variable.

To identify the cause of the collaboration exception, the exception object includes one of the exception types listed in Table 31. Exception types are string values for which Java static constants have been declared.

Table 31. Exception types
Exception-type constant Description
AnyException Any type of exception. If there are two exception branches--one that tests for a specific type of exception and one that tests for AnyException--the branch that tests for the specific type of exception is checked first. If the current exception does not match the specific exception, the branch that tests for AnyException is processed next.
AttributeException Attribute access problem, for example, the collaboration called getDouble() on a String attribute or called getString() on a nonexistent attribute.
JavaException Problem with Java code that is not part of the collaboration API.
ObjectException Invalid business object passed to a method.
OperationException Service call was improperly set up and could not be sent.
ServiceCallException Service call failed for reasons outside the collaboration. For example, a connector or application is unavailable, or the there is a network outage.
SystemException Any internal error within the InterChange Server Express system.
TimeoutException Synchronous or asynchronous inbound service call timed out.
TransactionException Error related to the transactional behavior of a transactional collaboration. For example, rollback failed or the collaboration could not apply compensation.

Note:
When you define an exception branch in a decision node, you specify the exception type to check for in the condition of the exception branch. For more information, see Catching the exception.

Some of these exception types have numerous situations that can cause them. For such exception types, the exception object often includes an exception subtype, which provides additional information about the cause of the exception. The two main exception types that use exception subtypes are JavaException and ServiceCallException. For more information, see the description of getSubType().

Copyright IBM Corp. 2003, 2004