Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
29 views26 pages

UML 2 Activity Diagram

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)
29 views26 pages

UML 2 Activity Diagram

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/ 26

LIUC Università Cattaneo

Ingegneria Gestionale

Modeling of business processes


with UML - Activity diagram

Ing. Matteo Ferroni


Modeling of business processes with UML

๏ Business processes can be modeled with UML


according to various complementary perspectives:

‣ Representation of their external behaviour


(Use Case diagram)

‣ Representation of their internal behaviour


(Activity diagram)

‣ Representation of the information used


(Class diagram)
Activity diagram
Activity diagram

๏ The activity diagram makes it possible to graphically


represent the flow of the different activities that
constitute a use case or a business process

๏ The diagram shows which activities are executed


sequentially and which in parallel

๏ While use cases describe the process according to an


“external” perspective (i.e., what it does and how it
interacts with the players), the activity diagrams describe
it according to an “internal” point of view (i.e., how the
process works)
Activities

๏ Basic element: Activity

๏ Basic work unit (it is something the process does)


Activities

๏ Example for a marketplace

Memorize Issue
the order the invoice
Sequential execution
๏ Sequential execution of activities (i.e., the activity has
one single incoming connection and one single outgoing
connection)

Show
purchase form

Obtain
purchase details

๏ The arrow which links the activities is called transition


Conditional execution (1)
๏ Conditional execution of activities
‣ BRANCH
• the activity has one single incoming transition and more
outgoing transitions with conditions
• after the action has ended, the conditions are evaluated
and only the action going out of the branch whose
condition is true is executed (the conditions must be
mutually exclusive)

[cond 1] [cond 2] [else]


Conditional execution (2)
๏ Conditional execution of activities
‣ MERGE
• the activity has more incoming transitions and one
outgoing transition
• it ends a conditional block begun with a branch
Conditional execution (3)
๏ Example: shipping
Check of customer’s
choice for the kind of
shipping

[quick shipping] [else]

Shipping by carrier Shipping via mail

Closing of order
Conditional execution (4)
๏ Example: validation

Show
purchase form

check
purchase details

[incomplete]

[OK]

Memorize
order
Parallel execution (1)
๏ Parallel execution of activities
‣ FORK
• has one single incoming transition and more outgoing
transitions
• when the action preceding the fork ends, all the branches
of actions going out of the fork are executed
– in parallel
– randomly
Parallel execution (2)
๏ Parallel execution of activities
‣ in parallel (A and B are executed at the same time as C
and D)
‣ randomly (A, B, C, D; or C, A, B, D; and so on)

A C

B D
Parallel execution (3)
๏ Parallel execution of activities
‣ JOIN
• the activity has more incoming transitions and one
outgoing transition, and ends a parallel block begun with a
fork
• the activity going out of the join can be executed only after
all activities entering the join are finished (the join
synchronizes the activities)
Parallel execution (4)
๏ Example: packaging, labelling and invoicing
Collect wares
from warehouse

Prepare label
Package wares
for shipping

Print invoice

Label packaged
wares and attach
invoice
Start/end symbols

๏ The activity diagram has a start point and one or


more end points

Start

End
Example - From Use Case to Activity (1)

๏ Activity diagram for the use case “Show list of exams”

Show list of exams

Student
Example - From Use Case to Activity (1)

๏ Activity diagram for the use case “Show list of exams”

Check if the user has


already been identified by
the system [at least one open
[else]
date]

Show a notice
Show list of exams “all dates closed”
[no]

[yes]

Query
in the archive
“DATES OF EXAMS”

Check if there are


open dates
Example - From Use Case to Activity (2)

๏ Activity diagram for the use case “Creation and


submission of an Order”

Creation and submission


of an Order
Customer
Example - From Use Case to Activity (2)
Detailed description of a use case:
๏ Definition: Creation and submission of Order
๏ Players: customer
๏ Main flow:
‣ The user asks to view the order form
‣ The user fills in the form, specifying her/his personal data, the chosen
configuration, the quantity to order, the payment details (bank transfer or credit
card), the kind of shipping (quick or normal)
‣ The user submits the order
‣ The system checks the consistency and the completeness of the data in the order
‣ When the payment is by credit card, the system checks the validity of the card
and the availability for payment
‣ The order is accepted, memorized and forwarded to the vendor to be dealt with
๏ Anomalous cases (minor):
‣ If the data submitted by the user are incomplete, the order form is submitted
again to the user
‣ If the credit card has no credit left, the client is invited to pay by bank transfer
Example - From Use Case to Activity (2)

๏ Activity diagram for the use case “Creation and


submission of an Order”
[bank transfer] [credit card]

Request to order Check credit card

[valid] [no valid]


Obtain purchase and
payment details

Show
purchase form Memorize order and
send it to the vendor

Submission of
purchase form

[incomplete] [complete]
Split of activities (1)

๏ An activity can be split into subactivities so that it


can be described in more detail

๏ The split also enables the modularization of the


diagram and it is useful to make it clearer and reuse
descriptions which are common to more diagrams

๏ The diagram can show the symbol of the activity


without showing the description in detail (directing it to
another document), or showing both
Split of activities (2)
๏ Example
Check of customer’s
choice for the kind of
shipping
Check of customer’s
choice for the kind of
shipping Shipping

[quick shipping] [else]

(*)
Shipping Shipping
by carrier Shipping via mail

Closing of order
Closing of order

(*) The detailed description of “Shipping”


is given in another document
Swimlanes (1)

๏ The activity diagram doesn’t indicate which players


or units of the organization carry out (or are
responsible for) an activity

๏ It is thus possible to add this information to an


activity diagram through the use of swimlanes
Swimlanes (2)
Purchase Warehouse
๏ Example
Customer office

Request
service

Receive order

Search for
Payment product

Send
product

Receive
product
Exercises

๏ ATM Machine (Activity Diagram)

๏ Building permissions (Activity Diagram)

๏ Bookshop (Activity Diagram)

๏ Highway tolls (Use Case Diagram)

You might also like