Top Banner
Modeling UML Activity Diagram Prof. U.VERMA C.E. Dept. MPSTME Shirpur Campus 1 [email protected]
26
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Exp 5 Modeling UML Activity Diagram

Modeling UML Activity

Diagram

Prof. U.VERMA

C.E. Dept.

MPSTME Shirpur Campus

[email protected]

Page 2: Exp 5 Modeling UML Activity Diagram

Activity Diagrams

• Activity diagrams are one of the five diagrams inthe UML for modeling the dynamic aspects ofsystems.

• Activity diagrams fall under the category ofbehavioral diagrams in Unified ModelingLanguage.

• Visually represent the flow of control in a system.

• It is more powerful than a simple flow chart sinceit can represent various other concepts likeconcurrent activities, their joining, and so on.

[email protected]

Page 3: Exp 5 Modeling UML Activity Diagram

Activity Diagrams cont’d

• An activity diagram is essentially a flowchart,

showing flow of control from activity to

activity. Unlike a traditional flowchart, an

activity diagram shows concurrency as well as

branches of control.

[email protected] 3

Page 4: Exp 5 Modeling UML Activity Diagram

Components of an Activity Diagram

• Activity

• Flow

• Decision

• Merge

• Fork

• Join

• Note

• Partition

[email protected]

Page 5: Exp 5 Modeling UML Activity Diagram

Activity

• An activity denotes a particular action taken in thelogical flow of control.

• Behavior expressed as a set of actions connectedby control and data flows.

• An activity is represented with a roundedrectangle.

• A label inside the rectangle identifies thecorresponding activity.

• There are two special type of activity nodes:initial and final.

[email protected]

Page 6: Exp 5 Modeling UML Activity Diagram

Activity cont’d

• Initial node represents the starting point of a

flow in an activity diagram.

• A final node represents the end point of all

activities.

[email protected]

Page 7: Exp 5 Modeling UML Activity Diagram

Flow

• A flow (also termed as edge, or transition) is

represented with a directed arrow.

• This is used to depict transfer of control from

one activity to another .

• A flow is often accompanied with a label,

called the guard condition, indicating the

necessary condition for the transition to

happen.

[email protected]

Page 8: Exp 5 Modeling UML Activity Diagram

Decision

• A decision node, represented with a diamond, is a point where

a single flow enters and two or more flows leave.

• The outgoing edges often have guard conditions indicating

true-false or if-then-else conditions. However, they can be

omitted in obvious cases.

• note can be attached to the decision node indicating the

condition to be tested.

[email protected]

Page 9: Exp 5 Modeling UML Activity Diagram

Merge

• This is represented with a diamond shape, with

two or more flows entering, and a single flow

leaving out.

• A merge node represents the point where at

least a single control should reach before

further processing could continue.

[email protected]

Page 10: Exp 5 Modeling UML Activity Diagram

Fork

• Fork is a point where parallel activities begin. For

example, when a student has been registered with

a college, he can in parallel apply for student ID

card and library card.

• A fork is graphically depicted with a black bar,

with a single flow entering and multiple flows

leaving out.

[email protected]

Page 11: Exp 5 Modeling UML Activity Diagram

Join

• A join is depicted with a black bar, with

multiple input flows, but a single output flow.

• It represents the synchronization of all

concurrent activities.

• Unlike a merge, in case of a join all of the

incoming controls must be completed before

any further progress could be made.

[email protected]

Page 12: Exp 5 Modeling UML Activity Diagram

Join cont’d

• For example, a sales order is closed only when

the customer has receive the product, and the

sales company has received it's payment.

[email protected]

Page 13: Exp 5 Modeling UML Activity Diagram

Note

• UML allows attaching a note to different

components of a diagram to present some

textual information.

• The information could simply be a comment or

may be some constraint.

[email protected]

Page 14: Exp 5 Modeling UML Activity Diagram

Partition

• Different components of an activity diagram

can be logically grouped into different areas,

called partitions or swim lanes.

• The drawing area can be partitioned into

multiple compartments using vertical (or

horizontal) parallel lines.

• Partitions in an activity diagram are not

mandatory.

[email protected]

Page 15: Exp 5 Modeling UML Activity Diagram

A Simple Example

• Figure shows a simple activity diagram with

two activities.

• The figure depicts two stages of a form

submission.

• At first a form is filled up with relevant and

correct information. Once it is verified that

there is no error in the form, it is then

submitted.

[email protected]

Page 16: Exp 5 Modeling UML Activity Diagram

A Simple Example cont’d

[email protected]

Page 17: Exp 5 Modeling UML Activity Diagram

Guidelines for drawing an Activity

Diagram

• Identify tiny pieces of work being performed

by the system.

• Identify the next logical activity that should be

performed.

• Put guard conditions on the edges to avoid

confusion

[email protected]

Page 18: Exp 5 Modeling UML Activity Diagram

Case Study of LIS

[email protected] 18

Page 19: Exp 5 Modeling UML Activity Diagram

Case Study of LIS cont’d

From the given problem we can identify at least

three different functionality offered by the

system:

• Register a new member

• Issue book

• Update inventory

[email protected] 19

Page 20: Exp 5 Modeling UML Activity Diagram

Activity diagram for user

registration

A new user fills up the registration form for library membership (either online or in

paper), and submits to the librarian. Of course, an already registered user can't create

another account for himself (or, herself). For users' who don't have an account already

and have submitted their registration forms, the librarian verifies the information

provided, possibly against the central database used by the institution. If all information

have been provided correctly, librarian goes on with creating a new account for the

user. Otherwise, the user is asked to provide all and correct information in his (her)

registration form. Once a new account has been created for the user, he (she) is being

issued an ID card, which is to be provided for any future transaction in the library.

[email protected] 20

Page 21: Exp 5 Modeling UML Activity Diagram

Activity diagram for user

registration cont’d

[email protected] 21

Page 22: Exp 5 Modeling UML Activity Diagram

Activity diagram for issuing books

[email protected] 22

Page 23: Exp 5 Modeling UML Activity Diagram

Activity diagram for updating

inventory

[email protected] 23

Page 24: Exp 5 Modeling UML Activity Diagram

Draw Activity

Diagram for

Admission Procedure

at NMIMS University

[email protected] 24

Page 25: Exp 5 Modeling UML Activity Diagram

Activity Diagram for Student

Admission Procedure

[email protected] 25

Page 26: Exp 5 Modeling UML Activity Diagram

Exercise

Draw Activity Diagram for Online Budgeting

Control System.

• Identify Activities

• Transition from one activity to another activity

• Identify Parallel Activities

• Identify role for component

• Identify the guard conditions

[email protected] 26