UML Diagrams Zicomi Systems publishes some UML example diagrams online from the world famous UML dictionary. more...
Version 2.5 Released Zicomi Systems is delighted to announce that version 2.5 of Zicomi Mentor is released. With support for UML 2.0 and all thirteen UML diagrams more...
Zicomi Systems' Director speaks about the UML at Objects by Design - an informative interview more...
Partner Programme Zicom Systems is delighted to announce a new world wide partner programme, become a partner today. more...
OMG Member Zicom Systems is made a member of the OMG!
Exception Handler
An exception handler is an element that allows an action (protected node) to be protected by specifying an alternate action to execute when a certain condition or event occurs in the execution of the protected node. The alternate action called the handler has an input pin, which specifies the type of the exception. The handler will only be invoked if the type of the exception is the same or a child of the type specified by the handler.
Explanation
During the execution of an action unusual or out of the ordinary events can occur. When a modeler is aware of the possibility of these situations arising, elements called exception handlers can be used, which are invoked when the situation occurs. The handler specifies an alternate action to deal with the unusual event. The exception handler is connected to the action in which the exception occurs (protected node) by a lightning bolt style flow. This flow terminates at an object node (pin) on the exception handlers body. When an exception occurs all exception handlers connected to the node are examined, the first one that has a matching type receives the token and the exception is said to be 'caught' and the handler 'invoked'. In the circumstance that none of the attached handlers have a matching type the exception is not caught and all tokens in the action (protected node) are terminated and the exception is propagated up to the enclosing activity. An exception handler is best thought of as an alternate action since the tokens that result from the invocation of the exception handler become the result tokens of the protected node. The action that is carried out by the exception handler has an identical relationship to the enclosing activity as the protected node itself.
An interruptible activity region is related to an exception handler in that both elements model how unusual or out of the ordinary events are handled. They both use a lightning bolt style flow as a conduit for the tokens. Both specify an alternate behavior when an event occurs that is exceptional or interrupts the main flow in the activity.