>
> my question is about adding the internal activites inside a state in a
> State diagram. my problem is that those activities are somehow complex
> that i want to model them with activity or sequence diagram and then
> link them to the activity inside the state. is this feasable?? if yes,
> can you please attach me a small example using any tool.
> if no, can you suggest me some other way to deal with these activities,
It is not only feasible, it is standard practice in most UML drawing
tools. However, it is usually done "under the hood" so that the linking
of state action to Activity Diagram is seamless in the tool's UI. The
tool can do this with a variety of mechanisms, like a hierarchical tree
structure where drilling down the tree yields the appropriate diagram
for the higher level element (e.g., class -> particular statechart ->
particular action -> AD). It is also common to use strategies like right
clicking to drill down. The tool will also provide a context for
creating the AD for the right action (e.g., one must have an action
selected in the tool before one can get to the menu item to create the
AD) to ensure the diagrams were linked properly
UML itself does not provide a specific mechanism for linking diagrams,
other than the meta model requiring that diagrams be linked. This dates
from the days when tools were not so fancy and all one had was a pile of
paper diagrams that one ordered manually and provided naming conventions
in case they got mixed up when one fell down a flight of stairs. As the
drawing tools became more sophisticated, they provided the linking
through the UI context so there was no need for explicit linking
constructs in UML itself. (Perhaps more to the point, there are many
possible ways to provide such linking so "hard-wiring" a particular
strategy in the UML specification could hinder providing creative tools.)
<aside>
It used to be routine to describe state actions with Activity Diagrams.
However, this has been largely replaced by text-based Abstract Action
Languages (AALs). That's because (A) actions deal only with algorithmic
behavior that is easily described with 3GL-like syntax and (B) it is
much easier to modify text (e.g., one always seems to have to add a
bubble in the middle of the densest part of the AD). Today all of the
translation tools (e.g., PathMATE, Bridgepoint, xUML, etc.) use AALs
rather than ADs.
You mention sequence diagrams. Generally they are not relevant to state
machines for two reasons. One is that all Interaction Diagrams are
designed to describe overall flow of control. IOW, they define where
messages go during object collaborations. The object state machines are
encapsulated at that level of abstraction so they are not visible. The
second reason is that SDs describe linear, synchronous processing where
the messages are always generated and consumed in the same predictable
order. But state machines are designed for asynchronous processing where
there may be arbitrary delays between generating and consuming a
message. Then the order of messages is not fixed. So one typically used
a Collaboration Diagram to describe communications between state machines.
</aside>
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
H. S. Lahman
H.la...@verizon.net
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html