Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
UML Basics

UML Basics

Ratings: (0)|Views: 18|Likes:
Published by ramachandra

More info:

Published by: ramachandra on Jan 03, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





UML basicsPart II: The activity diagram
Donald Bell
 IBM Global Services 
In June 2003,
The Rational Edge
 introduced a new article series byDonald Bell, IBM Global Services,called
UML basics
. The purpose of thisseries is to help readers becomefamiliar with the major diagrams thatcompose much of the UML. Part Ioffered a general overview of thesediagrams; this month, we continue theseries with a close look at the activitydiagram, including this diagram'scomplete UML v1.4 notation set.
The activity diagram'spurpose
The purpose of the activity diagram is to model the procedural flow of actions that are part of a larger activity. In projects in which use cases arepresent, activity diagrams can model a specific use case at a moredetailed level. However, activity diagrams can be used independently of use cases for modeling a business-level function, such as buying a concertticket or registering for a college class. Activity diagrams can also be usedto model system-level functions, such as how a ticket reservation datamart populates a corporate sales system's data warehouse.Because it models procedural flow, the activity diagram focuses on theaction sequence of execution and the conditions that trigger or guardthose actions. The activity diagram is also focused only on the activity'sinternal actions and
on the actions that call the activity in their processflow or that trigger the activity according to some event (e.g., it's 12:30on April 13
, and Green Day tickets are now on sale for the group's
Copyright Rational Software 2003 http://www.therationaledge.com/content/sep_03/f_umlbasics_db.jsp
summer tour).Although UML sequence diagrams can protray the same information asactivity diagrams, I personally find activity diagrams best for modelingbusiness-level functions. This is because activity diagrams show allpotential sequence flows in an activity, whereas a sequence diagramtypically shows only one flow of an activity. In addition, businessmanagers and business process personnel seem to prefer activitydiagrams over sequence diagrams -- an activity diagram is less "techie" inappearance, and therefore less intimidating to business people. Besides,business managers are used to seeing flow diagrams, so the "look" of anactivity diagram is familiar.
The notation
The activity diagram's notation is very similar to that of a statechartdiagram. In fact, according to the UML specification, an activity diagram isa variation of a statechart diagram
. So if you are already familiar withstatechart diagrams, you will have a leg up on understanding the activitydiagram's notation, and much of the discussion below will be review foryou.
The basics
First, let's consider the action element in an activity diagram, whoseofficial UML name is
action state
. In my experience, people rarely if evercall it an action state; usually they call it either
. In thisarticle, I will always refer to it as
and will use the term
onlyto refer to the whole task being modeled by the activity diagram. Thisdistinction will make my explanations easier to understand.An action is indicated on the activity diagram by a "capsule" shape -- arectangular object with semicircular left and right ends (see Figure 1). Thetext inside it indicates the action (e.g., Customer Calls Ticket Office orRegistration Office Opens).
Figure 1: A sample action that is part of an activity diagram.
Because activity diagrams show a sequence of actions, they must indicatethe starting point of the sequence. The official UML name for the startingpoint on the activity diagram is
initial state
, and it is the point at whichyou begin reading the action sequence. The initial state is drawn as a solidcircle with a transition line (arrow) that connects it to the first action in theactivity's sequence of actions. Figure 2 shows what an activity diagram'sinitial state looks like. Although the UML specification does not prescribethe location of the initial state on the activity diagram, it is usually easiestto place the first action at the top left corner of your diagram.
Figure 2: The initial state clearly shows the starting point for theaction sequence within an activity diagram.
It is important to note that there can
be only one
initial state on anactivity diagram and
only one
transition line connecting the initial state toan action. Although it may seem obvious that an activity can have onlyone initial state, there are certain circumstances -- namely, thecommencement of asynchronous action sequences -- that may suggestthat a new initial state should be indicated in the activity diagram. UMLdoes not allow this. Figure 3 offers an example of an incorrect activitydiagram, because the initial state has two transition lines that point to twoactivities.
Figure 3: Incorrect rendering of an initial state within an activitydiagram. The initial state can indicate only ONE action.
With arrows indicating direction, the transition lines on an activity diagramshow the sequential flow of actions in the modeled activity. The arrow willalways point to the next action in the activity's sequence. Figure 4 shows acomplete activity diagram, modeling how a customer books a concertticket.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->