Question

HI, I recently was reverse engineering a certain project to UML, and was stuck at a point where I could not reach a conclusion. The code is fairly simple:

            ...
            try
            {
                sj = SendingJob.DeserializeXmlString("....");
                trcSrc.TraceInfo("....");
            }
            catch (FormatException)
            {
                trcSrc.TraceError("....");

                return "00 - Job Content Bad Format.";
            } ...

Firts off I modeled the code as such:


alt text


But after reading the following text:

"If an exception occurs while an action is executing, the execution is abandoned and there is no output from the action. If the action has an exception handler, the handler is executed with the exception information. When the exception handler executes, its output is available to the next action after the protected node, as though the protected node had finished execution."

... but the thing is my exception handler exits the catch block by returning a value, and stopping the activity. I tried to link the exception node to an activity final node, but my tool refuses to do it, and which I'm pretty sure is not the correct way to do it.

So my question is: How to model an activity diagram where an action throws an exception and its handler terminates the activity?

Was it helpful?

Solution

As I am not allowed to post images yet I'll try to describe my solution :) In your exception handler, include an action that represents what it does. You can then link that action to the termination node of the activity diagram.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top