0% found this document useful (0 votes)
10 views

Activity Diagram

The document discusses activity diagrams, which show the sequence and flow of activities through a system from start to finish. Activity diagrams use shapes like circles, diamonds, and bars to represent states like initial/final states, branches, forks, and joins that allow activities to be performed sequentially or in parallel. Basic elements, symbols, and notations of activity diagrams are described including how they can depict conditional and parallel logic flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Activity Diagram

The document discusses activity diagrams, which show the sequence and flow of activities through a system from start to finish. Activity diagrams use shapes like circles, diamonds, and bars to represent states like initial/final states, branches, forks, and joins that allow activities to be performed sequentially or in parallel. Basic elements, symbols, and notations of activity diagrams are described including how they can depict conditional and parallel logic flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

An activity is the execution of a task

whether it be a physical activity or the


execution of code.

Activity Simply put, the activity diagram shows the


sequence of activities.
Diagram
Like the simple flow chart, activity diagrams
have support for conditional behaviour, but
has added support for parallel execution as
well.
Basic Activity Diagram Symbols and Notations

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.

The join (bottom) represents the end of the


parallel behaviour and has any number of
transitions entering, and only one leaving.
Branching
A diamond represents a decision with alternate
paths. The outgoing alternates should be labeled
with a condition or guard expression.
You can also label one of the paths "else."

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.

•Diagrams are read from top to bottom


and have branches and forks to
describe conditions and parallel
activities.
• A fork is used when multiple activities are occurring at the
same time. The diagram below shows a fork after activity1.

• This indicates that both activity2 and activity3 are occurring


at the same time. After activity2 there is a branch.

• The branch describes what activities will take place based on


a set of conditions.

• All branches at some point are followed by a merge to


indicate the end of the conditional behavior started by that
branch.

• After the merge all of the parallel activities must be combined


by a join before transitioning into the final activity state.
• The diagram shows the flow of actions in the
system's workflow.

• The order is received the activities split into two


parallel sets of activities.

• 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.

•Depending on the condition either the


Overnight Delivery activity or the Regular
Delivery activity is performed.

•Finally the parallel activities combine to


close the order.
http://bdn.borland.com/article/0,1410,31863,00.htm
state diagram for an online order
[vehicle reg. number]

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.

• What you want to do is pick at random an as yet


unplayed track from the tracklist, play it and
mark it as played.

• When all the tracks are discovered to be marked


as played, clear all the marks

You might also like