Hi!
Here's a simple approach which allows you to represent exceptions thrown by your operations, but not to see them in browser or diagrams.
First off, there is a predefined stereotype "exception" which can be applied to a Class. Use that to represent your exceptions.
Secondly, create a UML Tagged Value Type (Settings - UML) as follows:
Name: throws
Description: Exception thrown by an operation
Detail:
Type=RefGUID;
Values=Class;
Stereotypes=exception;
Then, when you want to add an exception to an Operation, select the Operation and create a Tagged Value for it (either in the Operation's properties dialog or in the workspace's tagged values window).
In the popup dialog, select the "throws" tag from the "Tag" dropdown list (note that this disables the "Value" text field), and click OK.
Back in the tagged values window, the new tag "throws" has no value and its value field allows no manual input. Instead it has an ellipsis ("...") button, allowing you to select a Class with the «exception» stereotype.
You can create multiple "throws" tags on a single Operation. (There is a RefGUIDList tagged value type, which should allow multiple selections, but I haven't got that to work.)
Advantages to this approach:
- Quick to implement
- Works for RTF generation.
Disadvantages:
- Tags on operations are not visible in browser or in diagrams
- Limited use in MDA Transforms and code generation (since the templates assume each tag is uniquely named)
- There is no way to see whether or not a particular «exception» Class is used anywhere, which leads to maintenance problems (deleting a Class which is being used in a Tagged Value leaves the class GUID in the tag, which is very confusing).
The way around this last problem is to create an SQL Search as follows:
Name: Exception thrown - GUID
Query: select * from t_operationtag where Property="throws" and VALUE="<Search Term>"
Hope this works for you; if anyone has a more fully-fledged approach I'd be thrilled to hear it. I have noted that the t_operation table in the EA DB schema actually has a "Throws" column, but I haven't seen anything in it.
Cheers,
/Uffe