Activity diagram-UML diagram

ramakantsoni 14,108 views 30 slides Apr 26, 2015
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

Descriptive slides for the Activity Diagrams in UML


Slide Content

Duration : 3 Hrs
1
RamakantSoni
Assistant Professor
Dept. of Computer Science
B K Birla Institute of Engineering & Technology, Pilani, India
Ramakant Soni @ BKBIET Pilani

Activity Diagram
Activitydiagramisbasicallyaflowchartto
representtheflowfromoneactivitytoanother
activity.
Theactivitycanbedescribedasanoperation
Ramakant Soni @ BKBIET Pilani 2
Theactivitycanbedescribedasanoperation
ofthesystem.
Thisflowcanbesequential,branchedor
concurrent.

Purpose
Activitydiagramsarenotonlyusedforvisualizing
dynamicnatureofasystembuttheyarealsousedto
constructtheexecutablesystembyusingforwardand
reverseengineeringtechniques.
Itdoesnotshowanymessageflowfromoneactivityto
Ramakant Soni @ BKBIET Pilani 3
Itdoesnotshowanymessageflowfromoneactivityto
another.

So the purposes can be described as to:
•Draw the activity flow of a system.
•Describe the sequence from one activity to another.
Ramakant Soni @ BKBIET Pilani 4
•Describe the parallel, branched and concurrent flow
of the system.

How to draw Activity Diagram
Beforedrawinganactivitydiagramwemusthavea
clearunderstandingabouttheelementsusedinactivity
diagram.
First we should identify the following elements :
1.Activities
2.Association
Ramakant Soni @ BKBIET Pilani 5
2.Association
3.Conditions
4.Constraints
Oncetheabovementionedparametersareidentifiedweneedto
makeamentallayoutoftheentireflow.Thismentallayoutisthen
transformedintoanactivitydiagram.

Example of an order management system
The diagram is drawn with the four main activities :
•Send order by the customer
•Receipt of the order
•Confirm order
•Dispatch order
Afterreceivingtheorderrequestconditionchecksare
Ramakant Soni @ BKBIET Pilani 6
Afterreceivingtheorderrequestconditionchecksare
performedtocheckifitisnormalorspecialorder.
Afterthetypeoforderisidentifieddispatchactivityis
performedandthatismarkedastheterminationofthe
process.

Activity Diagram for order management system
Ramakant Soni @ BKBIET Pilani 7

Initial node
The filled circle is the starting point of the diagram
Activity Diagram components
Final node
The filled circle with a boarder is the ending point. An
activity diagram can have zero or more activity final
state.
8Ramakant Soni @ BKBIET Pilani

Activity
The rounded rectangle represents activities that occur. An
activity is not necessarily a program, it may be a manual thing
also.
Ramakant Soni @ BKBIET Pilani 9
Flow/ edge
The arrows in the diagram. No label is necessary.

Fork
A black bar ( horizontal/vertical ) with one flow going into it
and several leaving it. This denotes the beginning of parallel
activities.
Join
A block bar with several flows entering it and one leaving it.
this denotes the end of parallel activities
10Ramakant Soni @ BKBIET Pilani

Merge
A diamond with several flows entering and one leaving. The
implication is that all incoming flow to reach this point until
processing continues
Sub-activity indicator
The rake in the bottom corner of an activity, indicates that
the activity is described by a more finely detailed activity
diagram.
11Ramakant Soni @ BKBIET Pilani

Difference between Join and Merge
›Ajoinisdifferentfromamergeinthatthejoinsynchronizes
twoinflowsandproducesasingleoutflow.Theoutflowfrom
ajoincannotexecuteuntilallinflowshavebeenreceived.
›Amergepassesanycontrolflowsstraightthroughit.Iftwo
ormoreinflowsarereceivedbyamergesymbol,theactionormoreinflowsarereceivedbyamergesymbol,theaction
pointedtobyitsoutflowisexecutedtwoormoretimes.
12Ramakant Soni @ BKBIET Pilani

Decision
›A diamond with one flow entering and several leaving.
The flow leaving includes conditions as yes/ no state.
Flow final
›The circle with X through it. This indicates that Process
stop at this point.
13Ramakant Soni @ BKBIET Pilani

Accept Event Action
AcceptEventActionisanactionthatwaitsforthe
occurrenceofaneventmeetingspecified
condition.
14Ramakant Soni @ BKBIET Pilani

Send Signal Action
SendSignalActionisanactionthatcreatesa
signalinstancefromitsinputs,andtransmitsitto
thetargetobject,whereitmaycausethefiringof
astatemachinetransitionortheexecutionofan
activity.
15Ramakant Soni @ BKBIET Pilani

Swim lane
A partition in activity diagram by means of dashed line,
called swim lane. This swim lane may be horizontal or
vertical.
Vertical Swimlane Horizontal Swimlane
16Ramakant Soni @ BKBIET Pilani

Activity Diagram notation
text Start at the top black circle
If condition 1 is TRUE, go
right; if condition 2 is TRUE,
go down
At first bar (a synchronization
bar), break apart to follow two
Ramakant Soni @ BKBIET Pilani 17
bar), break apart to follow two
parallel paths
At second bar, come together
to proceed only when both
parallel activities are done

Activity Diagram notation
text
Activity–anoval
Trigger–pathexitinganactivity
Guard–eachtriggerhasaguard,a
logicalexpressionthatevaluatesto
“true”or“false”
SynchronizationBar–canbreaka
triggerintomultipletriggers
Ramakant Soni @ BKBIET Pilani 18
triggerintomultipletriggers
operatinginparallelorcanjoin
multipletriggersintoonewhenall
arecomplete
DecisionDiamond–usedto
describenesteddecisions(thefirst
decisionisindicatedbyanactivity
withmultipletriggerscomingout
ofit)

text
Use Case: Receiving an OrderUse Case: Receiving a Supply
Ramakant Soni @ BKBIET Pilani 19

Ramakant Soni @ BKBIET Pilani 20
Use Case: Receiving an Order and Receiving a Supply

SwimlaneActivity Diagram
Swimlanes-
ActivityDiagramsthatshow
activitiesbyclass.
Arrangeactivitydiagrams
intoverticalzonesseparated
bylines.
Ramakant Soni @ BKBIET Pilani 21
bylines.
Eachzonerepresentsthe
responsibilitiesofaparticular
class.
(forexampleaparticular
department).

Exercise 1: Online Shopping Process
Scenario:
“Onlinecustomercanbrowseorsearchitems,
viewspecificitem,addittoshoppingcart,view
andupdateshoppingcart,checkout.Usercan
Ramakant Soni @ BKBIET Pilani 22
andupdateshoppingcart,checkout.Usercan
viewshoppingcartatanytime.Checkoutis
assumedtoincludeuserregistrationandlogin.”

Activity diagram: Online Shopping Process
Ramakant Soni @ BKBIET Pilani 23

Exercise 2: Ticket Vending Machine
Scenario:
“ActivityisstartedbyCommuteractorwhoneedstobuya
ticket.Ticketvendingmachinewillrequesttripinformationfrom
Commuter.Thisinformationwillincludenumberandtypeof
tickets,e.g.whetheritisamonthlypass,onewayorround
ticket,routenumber,destinationorzonenumber,etc.
Ramakant Soni @ BKBIET Pilani 24
ticket,routenumber,destinationorzonenumber,etc.
Basedontheprovidedtripinfoticketvendingmachinewill
calculatepaymentdueandrequestpaymentoptions.Those
optionsincludepaymentbycash,orbycreditordebitcard.If
paymentbycardwasselectedbyCommuter,anotheractor,
Bankwillparticipateintheactivitybyauthorizingthepayment.

Activity diagram: Ticket Vending Machine
Ramakant Soni @ BKBIET Pilani 25

Exercise 3: Resolving issues in Software
Scenario:
“Prepareanactivitydiagramwhichshowshowto
resolveanissueinasoftwaredesign.Afterticketis
createdbysomeauthorityandtheissueisreproduced,
Ramakant Soni @ BKBIET Pilani 26
createdbysomeauthorityandtheissueisreproduced,
issueisidentified,resolutionisdetermined,issueisfixed
andverified,andticketisclosed,ifissuewasresolved.”

Activity diagram: Resolving issues in Software
Ramakant Soni @ BKBIET Pilani 27

Exercise 4: Single Sign-on for Google Apps
Scenario:
TointeractwithpartnercompaniesGoogleusessinglesign-onbasedonOASISSAML2.0
protocol.GoogleactsasserviceproviderwithservicessuchasGmailorStartPages.Partner
companiesactasidentityprovidersandcontrolusernames,passwords,andotherinformation
usedtoidentify,authenticateandauthorizeusersforwebapplicationsthatGooglehosts.Each
partnerprovidesGooglewiththeURLofitsSSOserviceaswellasthepublickeythatGooglewill
usetoverifySAMLresponses.
WhenauserattemptstousesomehostedGoogleapplication,suchasGmail,Googlegenerates
aSAMLauthenticationrequestandsendsredirectrequestbacktotheuser'sbrowser.Redirect
Ramakant Soni @ BKBIET Pilani 28
aSAMLauthenticationrequestandsendsredirectrequestbacktotheuser'sbrowser.Redirect
pointstothespecificidentityprovider.SAMLauthenticationrequestcontainstheencodedURL
oftheGoogleapplicationthattheuseristryingtoreach.
Thepartneridentityproviderauthenticatestheuserbyeitheraskingforvalidlogincredentials
orbycheckingforitsownvalidauthenticationcookies.ThepartnergeneratesaSAMLresponse
anddigitallysignsit.TheresponseisforwardedtoGoogle'sAssertionConsumerService(ACS).
Google'sACSverifiestheSAMLresponseusingthepartner'spublickey.Iftheresponseisvalid
anduseridentitywasconfirmedbyidentityprovider,ACSredirectstheusertothedestination
URL.Otherwiseuserwillseeerrormessage.

Activity diagram: Single Sign-on for Google Apps
Ramakant Soni @ BKBIET Pilani 29

References:
[1] http://www.uml-diagrams.org/
[2] http://en.wikipedia.org/wiki/Activity_diagram
[3] http://www.visual-paradigm.com/VPGallery/diagrams/Activity.html
[4] http://www.ibm.com/developerworks/rational/library/3101. html
Ramakant Soni @ BKBIET Pilani 30
ThanksThanks
4/26/2015 30
[5] http://www.uml-diagrams.org/activity-diagrams-examples.html