Activity Diagram
Activity Diagram
Initial State
A filled circle followed by an arrow represents the initial action state.
Start: each activity diagram has one start (above) at which the
sequence of actions begins.
Final State
An arrow pointing to a filled circle nested inside another circle
represents the final action state.
End: each activity diagram has one finish at which the sequence of actions ends
Action states
Action states represent the noninterruptible
actions of objects.
Action Flow
Action flow arrows illustrate the relationships
among action states.
Object Flow
Object flow refers to the creation and
modification of objects by activities. An object
flow arrow from an action to an object means
that the action creates or influences the object.
An object flow arrow from an object to an action
indicates that the action state uses the object.
Activity: activities are connected together by transitions. Transitions are
directed arrows flowing from the previous activity to the next activity.
They are optionally accompanied by a textual label of the form:
[guard] label
The guard is a conditional expression that when true indicates that the
transition is taken. The label is also optional and is
freeform.
•To show conditional behaviour use a branch and a merge.
•The top diamond is a branch and has only one transition flowing into it
and any number of mutually exclusive transitions flowing out.
•That is, the guards on the outgoing transitions must resolve themselves
so that only one is followed.
•The merge is used to end the conditional behaviour.
•There can be any number of incoming, and only one outgoing transition.
To show parallel behaviour use a fork and a
join. The fork (top) has one transition entering
and any number of transitions exiting, all of
which will be taken.
Synchronization
A synchronization bar helps illustrate parallel
transitions.
Synchronization is also called forking and joining.
Swimlanes
Swimlanes group related
activities into one column.
•Activity diagrams show the flow of
activities through the system.
• One side fills and sends the order while the other
handles the billing.
•On the Fill Order side, the method of
delivery is decided conditionally.
Select customer’s
contract
Activity diagram exercise
•Consider a music player such as a CD, MD or
MP3 player.
•Consider the random or shuffle play function
that they often provide. As an exercise in
abstraction, how would you describe the
meaning of shuffle.
• The temptation is to say pick a track at random.
But that won’t do: some tracks wouldn’t get
played and some tracks would get played more
than once.