25
1 Spring 2005 Specification and Analysis of Information Systems Eran Toch [email protected] Analysis and Specification of Information Systems Spring 2007 Session 9: Activity Diagrams

UML Activity Diagrams

Embed Size (px)

DESCRIPTION

A course on UML 2.0 Activity Diagram

Citation preview

Page 1: UML Activity Diagrams

1Spring 2005Specification and Analysis of Information Systems

Eran Toch

[email protected]

Analysis and Specification of Information Systems

Spring 2007

Session 9: Activity Diagrams

Page 2: UML Activity Diagrams

2

Outline

• Introduction

• Basics– Activities, Tokens, objects, signals

• Structures– Decomposition

Page 3: UML Activity Diagrams

3

Modeling Process

Intro | Basics | Structures

PhaseActionsOutcome

InitiationRaising a business needBusiness documents

RequirementsInterviewing stakeholders, exploring the system environment

Organized documentation

SpecificationAnalyze the engineering aspect of the system, building system concepts

Formal specification

DesignDefine architecture, components, data types, algorithms

Formal Specification

ImplementationProgram, build, unit-testing, integrate, documentation

Testable system

Testing & Integration

Integrate all components, verification, validation, installation, guidance

Testing results, Working sys

MaintenanceBug fixes, modifications, adaptationSystem versions

Page 4: UML Activity Diagrams

4

Behavior Modeling

Intro | Basics | Structures

CheckoutManager

Order

message: changestatus

Add to cart

Check availability

Supply Order

Notify User

[okay][problem]

Sequence Diagrams Activity Diagrams

Inventory

message: create In process

supplied

Order

State Diagrams

Page 5: UML Activity Diagrams

5

Strengths

• Best for modeling complex behavior– Which does not rely on interactions.– Has parallel behavior.

• Examples:– Business workflow (authorizing a loan).– User behavior (login/logout).– Algorithms.

Intro | Basics | Structures

Page 6: UML Activity Diagrams

6

Outline

• Introduction

• Basics– Activities, Tokens, objects, signals

• Structures– Decomposition

Page 7: UML Activity Diagrams

7

Customer Service Modeling

Intro | Basics | Structures

Page 8: UML Activity Diagrams

8

Activity Diagram for Customer Service

Start

Fork

decision

merge

Join Final Node

Action

Intro | Basics | Structures

Page 9: UML Activity Diagrams

9

Tokens

• The conceptual model of activity diagrams is based on tokens.

Intro | Basics | Structures

Page 10: UML Activity Diagrams

10

Tokens

Each fork node generates tokens, according to the number of paths.

The initial node creates a single token

Each join “collects” all the incoming tokens, producing a token afterwards.

An action requires a token to execute, and produce a token when it ends

Intro | Basics | Structures

Page 11: UML Activity Diagrams

11

Object Flows

• Objects describe the interface between actions

Call DataReceive Call Log Call

Receive Call Log Call

Object Flow

PinsCall data

Call data

Intro | Basics | Structures

Initiate Call

Call data

Page 12: UML Activity Diagrams

12

Pins

• Pins declare the interface between two actions.

Input Pin

Output Pin

Parameter Transformation

Intro | Basics | Structures

Page 13: UML Activity Diagrams

13

Objects with States

• Object nodes allow state change modeling:

Call Data[created]

Receive CallFind Customer

TypeCall Data

[classified]

Intro | Basics | Structures

Page 14: UML Activity Diagrams

14

Data Store

• A datastore is a stereotype for an object which stores objects persistently.

All entering tokens are copied so that tokens never leave the data store

If a token already present in the data store, it replaces the old one

Intro | Basics | Structures

Page 15: UML Activity Diagrams

15

Catching Signals

Time SignalEvent Signal

Flows when the time expression is true

Flows when an event occurs

Sends an event when a flow enters

Intro | Basics | Structures

Page 16: UML Activity Diagrams

16

Example: Volvo Blind Spot Info System (BLIS)

Intro | Basics | Structures

Page 17: UML Activity Diagrams

17

BLIS

Intro | Basics | Structures

Camera Behavior

Check Objects in Camera

Is object Detected?[no]

Side Object Detected

[yes]

Safety Controller Behavior

Side Object Detected

Detection data

Alarm Deciding

Side?

Left Alarm Right Alarm

[left] [right]

Page 18: UML Activity Diagrams

18

Outline

• Introduction

• Basics– Activities, Tokens, objects, signals

• Structures– Decomposition

Page 19: UML Activity Diagrams

19

Final Nodes

the activity is terminated when the first token arrives

the activity is terminated when all tokens in the graph are destroyed

Intro | Basics | Structures

Page 20: UML Activity Diagrams

20

• An action can be decomposed into an subactivity.

• The invoked activity graph can be used by many subactivity states.

Decomposition

Input Parameter Final Action

Intro | Basics | Structures

Page 21: UML Activity Diagrams

21

Partitions

• Partitions (swimlanes) can group actions by: – class, business unit, person etc…

• Can be multidimensional (not always possible).

RegisterBug

EvaluateImpact

FixBug

RevisePlan

ReleaseFix

TestFix

[ priority = 1]

Management

Support

Engineering

Intro | Basics | Structures

Page 22: UML Activity Diagrams

22

Pre / Post Conditions

for Decompositions

for Actions

Intro | Basics | Structures

Page 23: UML Activity Diagrams

23

Exceptions

• Exception represent errors and unexpected situations

interruptible region

Exception Edge

What happens to the tokens?

Exception Handler

Intro | Basics | Structures

Page 24: UML Activity Diagrams

24

Exception – cont’d

Multiple events

Actions can throw events too

Exception info can be modeled

Multiple event handlers

Intro | Basics | Structures

Page 25: UML Activity Diagrams

25

Summary

Activity Diagrams:– Represent workflows– Good for designing activities

Basic Elements– Activities– Objects– Signals

Structures – Tokens– Decomposition– Interfaces