Activity Diagrams
Maher Sarem
ME CSE(IT)
Activity Diagram
• Activity diagrams represent the business and
operational workflows of a system.
• Activity diagrams are the object-oriented
equivalent of flow charts and data-flow
diagrams from structured development
• Activity diagrams describe the workflow
behavior of a system
• The process flows in the system are captured
in the activity diagram
• Elements of activity diagram
Action States and Activity States
• Action states are atomic and cannot be
decomposed
– Work of the action state is not interrupted
• Activity states can be further decomposed
– Their activity being represented by other activity
diagrams
– They may be interrupted
Transitions
• When the action or activity of a state completes, flow of
control passes immediately to the next action or activity state
• A flow of control has to start and end someplace
– initial state -- a solid ball
– stop state -- a solid ball inside a circle
Branching
• A branch specifies alternate paths taken based on
some Boolean expression
• A branch may have one incoming transition and
two or more outgoing ones
Fork
• A fork may have one incoming transitions and two
or more outgoing transitions
– each transition represents an independent flow of
control
– conceptually, the activities of each of outgoing
transitions are concurrent
Join
• A join may have two or more incoming transitions
and one outgoing transition
– above the join, the activities associated with each of
these paths continues in parallel
– at the join, the concurrent flows synchronize
• each waits until all incoming flows have reached the join, at
which point one flow of control continues on below the join
Swim Lanes
create a receipt activity
create a receipt
Withdraw cash in ATM machine
processing an order
Once 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