Activity diagram revisited
Download
1 / 15

Activity Diagram - Revisited - PowerPoint PPT Presentation


  • 1419 Views
  • Uploaded on

Activity Diagram - Revisited Activity Diagram Also called an “activity graph”, is a variation of a state machine representing actions and subactivities Remember the difference between “activity” and “action” in UML Activity : A sequence of actions that take finite time and can be interrupted

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Activity Diagram - Revisited' - omer


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Activity diagram revisited l.jpg

Activity Diagram - Revisited

C-S 546


Activity diagram l.jpg
Activity Diagram

  • Also called an “activity graph”, is a variation of a state machine representing actions and subactivities

    • Remember the difference between “activity” and “action” in UML

    • Activity : A sequence of actions that take finite time and can be interrupted

    • Action: An atomic task that cannot be interrupted (at least from user’s perspective)

C-S 546


Activity diagram continued l.jpg
Activity Diagram (continued)

  • Transitions in an activity diagram do not have labels

    • They indicate the completion of an action or subactivity and show the sequence of actions or subactivities

    • Consequently, these transitions are not based on external events

  • An activity diagram may describe a use case, an operation or a message

    • Purpose: to describe implementation-oriented details

C-S 546


Activity diagram basic syntax l.jpg
Activity Diagram – Basic Syntax

Action 1

Action 2

Action 3

Action 4

[C]

[~C]

split

merge

C-S 546


Activity diagram semantics l.jpg
Activity Diagram - semantics

  • Each action state must have a label; otherwise, no information is conveyed by that action state

  • A transition can be split (see the vertical bar) into multiple transitions that can reach multiple action states

    • These transitions occur concurrently; in the previous diagram, “Action 2” and “Action 3” said to occur concurrently, after “Action 1”

C-S 546


Activity diagram semantics continued l.jpg
Activity Diagram – Semantics (continued)

  • Two or more transitions can be combined together using a merge (the same vertical bar notation)

    • The destination after the merge can be reached ONLY AFTER the source actions are completed

    • In the previous diagram, if “Action 4” is invoked, the entire activity terminates ONLY AFTER “Action 2” and “Action 4” complete

C-S 546


Activity diagram semantics continued7 l.jpg
Activity Diagram – Semantics (continued)

  • An outgoing transition from an action state may end up in a condition box (a diamond symbol) and hence will be split into 2 or 3 transitions

    • The conditions must be MUTUALLY EXCLUSIVE

  • Action state labels may represent methods and hence may include parameters

C-S 546


Slide8 l.jpg

[No coffee]

[No cola]

Find Beverage

[found cola]

[found coffee]

Put Coffee in Filter

Add Water

Get Cups

Get cola can(s)

Put filter in M/c

Switch on M/c

Wait until brewed

Drink

Pour into cup

Preparing Beverages - ©UML Manual version 1.5

C-S 546


Slide9 l.jpg

false

amount > 0

report error

true

false

balance  amount

amount – balance  N

false

report error

true

true

balance = balance - amount

Use case “withdraw” with overdraft protection

‘N’ represents overdraft limit

C-S 546


Subactivity l.jpg
Subactivity

An action state in an activity diagram can be represented by a subactivity as shown below

Subactivity

A subactivity represents a simplification of another activity diagram

It reduces the space for an activity diagram

C-S 546


Subactivity semantics l.jpg
Subactivity - semantics

  • A subactivity is a representation of another activity diagram

  • The incoming arrow to a subactivity matches with the initial state of the activity diagram represented by the subactivity

  • The outgoing arrow from a subactivity matches with the final state of the activity diagram represented by the subactivity

C-S 546


Swimlanes l.jpg
Swimlanes

  • Several activity diagrams can be merged into one diagram

    • particularly to show the interacting actions between these diagrams

  • Each activity diagram is enclosed in a separate box and the boxes are joined together in the swimlane diagram

  • See the example in the next slide

C-S 546


Slide13 l.jpg

Customer

Sales

Stockroom

Request service

Take Order

Pay

Fill Order

Deliver order

Collect order

C-S 546


Objects as parameters l.jpg
Objects as parameters

  • Objects passed as parameters between action states can be represented in the activity diagram (and in swimlane diagram) using the same syntax for objects

  • The transition between an object parameters and an action state is represented with a dashed line, instead of a solid line

C-S 546


Slide15 l.jpg

Customer

Sales

Stockroom

Request service

: Order [placed]

:Order [entered]

Take Order

Pay

Fill Order

: Order [filled]

:Order [delivered]

Deliver order

Collect order

C-S 546


ad