SlideShare a Scribd company logo
1 of 41
Business Informatics Group
Institute of Software Technology and Interactive Systems
Vienna University of Technology
Favoritenstraße 9-11/188-3, 1040 Vienna, Austria
phone: +43 (1) 58801-18804 (secretary), fax: +43 (1) 58801-18896
office@big.tuwien.ac.at, www.big.tuwien.ac.at
Object-Oriented Modeling
Activity Diagram
Slides accompanying UML@Classroom
Version 1.0
© BIG / TU Wien
Literature
 The lecture is based on the following book:
 Use Case Diagram
 Structure Modeling
 State Machine Diagram
 Sequence Diagram
 Activity Diagram
UML @ Classroom:
An Introduction to Object-Oriented Modeling
Martina Seidl, Marion Scholz, Christian Huemer
and Gerti Kappel
Springer Publishing, 2015
ISBN 3319127411
2
© BIG / TU Wien
Content
 Introduction
 Activities
 Actions
 Edges
 Control flow
 Object flow
 Initial node, activity final node, flow final node
 Alternative paths
 Concurrent paths
 Object nodes
 Event-based actions and call behavior actions
 Partitions
 Exception handling
3
© BIG / TU Wien
Introduction
 Focus of activity diagram: procedural processing aspects
 Flow-oriented language concepts
 Based on
 languages for defining business processes
 established concepts for describing concurrent communicating processes
(token concept as found in petri nets)
 Concepts and notation variants cover broad area of applications
 Modeling of object-oriented and non-object-oriented systems
4
Activity
 Specification of user-defined behavior at different levels of granularity
 Examples:
 Definition of the behavior of an operation in the form of individual
instructions
 Modeling the course of actions of a use case
 Modeling the functions of a business process
 An activity is a directed graph
 Nodes: actions and activities
 Edges: for control and object flow
 Control flow and object flow define
the execution
 Optional:
 Parameter
 Pre- and postconditions
Input
parameter
Node Edge
Output
parameter
5
© BIG / TU Wien
Action
 Basic element to specify user-defined behavior
 Atomic but can be aborted
 No specific rules for the description of an action
Definition in natural language or in any programming language
 Process input values to produce output values
 Special notation for predefined types of actions, most importantly
 Event-based actions
 Call behavior actions
6
© BIG / TU Wien
 Connect activities and actions to one another
 Express the execution order
 Types
 Control flow edges
 Define the order between nodes
 Object flow edges
 Used to exchange data or objects
 Express a data/causal dependency between nodes
 Guard (condition)
 Control and object flow only continue if
guards in square brackets
evaluate to true
Edges
Object flow
Control flow
7
© BIG / TU Wien
Token
 Virtual coordination mechanism that describes the execution exactly
 No physical component of the diagram
 Mechanism that grants the execution permission to actions
 If an action receives a token, the action can be executed
 When the action has completed, it passes the token to a subsequent
action and the execution of this action is triggered
 Guards can prevent the passing of a token
 Tokens are stored in previous node
 Control token and object token
 Control token: “execution permission" for a node
 Object token: transport data + “execution permission”
8
© BIG / TU Wien
Beginning and Termination of Activities
 Initial node
 Starts the execution of an activity
 Provides tokens at all outgoing edges
 Keeps tokens until the successive nodes accept them
 Multiple initial nodes to model concurrency
 Activity final node
 Ends all flows of an activity
 First token that reaches the activity final node terminates the entire activity
 Concurrent subpaths included
 Other control and object tokens are deleted
 Exception: object tokens that are already present at the output parameters of the
activity
 Flow final node
 Ends one execution path of an activity
 All other tokens of the activity remain unaffected
9
© BIG / TU Wien
Alternative Paths – Decision Node
 To define alternative branches
 „Switch point“ for tokens
 Outgoing edges have guards
 Syntax: [Boolean expression]
 Token takes one branch
 Guards must be mutually exclusive
 Predefined: [else]
 Decision behavior
 Specify behavior that is necessary for the evaluation of the guards
 Execution must not have side effects
10
© BIG / TU Wien
Alternative Paths – Merge Node
 To bring alternative subpaths together
 Passes token to the next node
 Combined decision and merge node
 Decision and merge nodes can also be used to model loops:
11
© BIG / TU Wien
Example: Alternative Paths
12
© BIG / TU Wien
Concurrent Paths – Parallelization Node
 To split path into concurrent subpaths
 Duplicates token for all outgoing edges
 Example:
13
© BIG / TU Wien
Concurrent Paths – Synchronization Node
 To merge concurrent subpaths
 Token processing
 Waits until tokens are present at all incoming edges
 Merges all control tokens into one token and passes it on
 Passes on all object tokens
 Combined parallelization and synchronization node:
14
© BIG / TU Wien
Example: Equivalent Control Flow
… equivalent to …
15
© BIG / TU Wien
Example: Create and Send Invitations to a Meeting
 While invitations are printed, already printed invitations are addressed.
 When all invitations are addressed, then the invitations are sent.
16
Example: Conduct Lecture (Student Perspective)
17
NOT equivalent … why?
… the first token that reaches the activity final node terminates the entire activity
… a parallelization node duplicates an incoming token for all outgoing edges
… a decision node passes the token to one outgoing edge (depending on the result of the
evaluation of the guard)
… if all incoming edges of an action have a token, the action is activated and is ready for execution
… all outgoing edges of all initial nodes are assigned a token….
… a merge node individually passes each token it gets to its outgoing edge
… a synchronization node waits until all incoming edges have a token, merges them to a single
token and passes it to its outgoing edge
… before the execution, the action consumes one token from every incoming edge;
after the execution, the action passes one token to every outgoing edge
Example: Token (Control Flow)
x x x
x
x
x
x
x
x x
x
x
x
x
x
x
x
End !
x
x
18
 Contains object tokens
 Represents the exchange of data/objects
 Is the source and target of an object flow edge
 Optional information: type, state
 Notation variant: object node as parameter
 For activities
 For actions (“pins”)
Object Node
Input
parameter
Output
parameter
19
© BIG / TU Wien
Example: Object Node
20
© BIG / TU Wien
Central Buffer
 For saving and passing on object tokens
 Transient memory
 Accepts incoming object tokens from object nodes and passes them on
to other object nodes
 When an object token is read from the central buffer, it is deleted from
the central buffer and cannot be consumed again
21
© BIG / TU Wien
Data Store
 For saving and passing on object tokens
 Permanent memory
 Saves object tokens permanently, passes copies to other nodes
22
© BIG / TU Wien
Weight of Edges
 Minimal number of tokens that must be present for an action to be
executed
 Default: 1
 All tokens present have to be consumed: 0 (also all or *)
23
© BIG / TU Wien
Connector
 Used if two consecutive actions are far apart in the diagram
 Without connector:
 With connector
24
Event-Based Actions
 To send signals
 Send signal action
 To accept events
 Accept event action
 Accept time event action
25
© BIG / TU Wien
Example: Accept Event Action
26
© BIG / TU Wien
Call Behavior Action
 The execution of an action can call an activity
 Content of the called activity can be modeled elsewhere
 Advantages:
 Model becomes clearer
 Reusability Name of the called activity
Inverted fork symbol
27
© BIG / TU Wien
Partition
 “Swimlane”
 Graphically or textual
 Allows the grouping of nodes and edges of an activity due to
responsibilities
 Responsibilities reflect organizational units or roles
 Makes the diagram more structured
 Does not change the execution semantics
 Example: partitions Student and Institute Employee (with
subpartitions Professor and Secretary)
28
© BIG / TU Wien
Example: Partitions
29
© BIG / TU Wien
Multidimensional Partitions
 Graphical notation … or alternatively textual notation
30
Example: Issue Student ID on Paper (1/2)
 State machine diagram of Student ID:
 Activity diagram – control flow:
31
Example: Issue Student ID on Paper (2/2)
 Control flow (green) and object flow (red) in one activity diagram
32
© BIG / TU Wien
Exception Handling – Exception Handler
 Predefined exceptions
 Defining how the system has to react in a specific error situation
 The exception handler replaces the action where the error occurred
 If the error e occurs…
 All tokens in Action A are deleted
 The exception handler is activated
 The exception handler is executed instead of
Action A
 Execution then continues regularly
33
Example: Exception Handler
34
© BIG / TU Wien
Exception Handling– Interruptible Activity Region
 Defining a group of actions whose execution is to be terminated
immediately if a specific event occurs. In that case, some other
behavior is executed
 If E occurs while B or C are executed
 Exception handling is activated
 All control tokens within the dashed rectangle (= within B and C) are
deleted
 D is activated and executed
 No “jumping back” to the regular execution!
35
© BIG / TU Wien
Example: Interruptible Activity Region
36
© BIG / TU Wien
Name Notation Description
Action node
Activity node
Represents an action (atomic!)
Represents an activity (can be
broken down further)
Initial node
Start of the execution of an
activity
Activity final
node
End of ALL execution paths of an
activity
Notation Elements (1/5)
37
© BIG / TU Wien
Notation Elements (2/5)
Name Notation Description
Decision node
Merge node
Splitting of one execution path
into alternative execution paths
Merging of alternative execution
paths into one execution path
Parallelization
node
Synchronization
node
Splitting of one execution path
into concurrent execution paths
Merging of concurrent execution
paths into one execution path
38
© BIG / TU Wien
Name Notation Description
Flow final node
End of ONE execution path of an
activity
Edge
Connection between the nodes of
an activity
Call behavior
action
Action A refers to an activity of
the same name
Partition
Grouping of nodes and edges
within an activity
Notation Elements (3/5)
39
© BIG / TU Wien
Notation Elements (4/5)
Name Notation Description
Send signal
action
Transmission of a signal to a
receiver
Asynchronous
accept (timing)
event action
Wait for an event E or a time
event T
Object node Contains data or objects
Parameter for
activities
Parameter for
actions (pins)
Contains data and objects as input
and output parameters
40
© BIG / TU Wien
Notation Elements (5/5)
Name Notation Description
Exception
Handler
Exception handler is executed
instead of the action in the event
of an error e
Interruptible
activity region
Flow continues on a different
path if event E is detected
41

More Related Content

Similar to 05_ActivityDiagram_slides_2015.pptx

Operation research's CPM techniques
Operation research's CPM techniques Operation research's CPM techniques
Operation research's CPM techniques Mohammad Younus
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram modelahmed zewita
 
DDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdfDDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdfEleonora Ciceri
 
Attach Me, Detach Me, Assemble Me like you Work
Attach Me, Detach Me, Assemble Me like you WorkAttach Me, Detach Me, Assemble Me like you Work
Attach Me, Detach Me, Assemble Me like you WorkJean Vanderdonckt
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsAmr E. Mohamed
 
ETOS discrete event simulation framework focused on easier team cooperation
ETOS discrete event simulation framework focused on easier team cooperationETOS discrete event simulation framework focused on easier team cooperation
ETOS discrete event simulation framework focused on easier team cooperationJiriFiser
 
Lec 09 network scheduling_techniques
Lec 09 network scheduling_techniquesLec 09 network scheduling_techniques
Lec 09 network scheduling_techniquesSAJID ALI RUK
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD pptPRIANKA R
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsAmr E. Mohamed
 
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. LaukePointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. LaukePatrick Lauke
 
Master Thesis Presentation
Master Thesis PresentationMaster Thesis Presentation
Master Thesis PresentationMohamed Sobh
 
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...Huy Tran
 
A component based architecture for the Web of Things
A component based architecture for the Web of ThingsA component based architecture for the Web of Things
A component based architecture for the Web of ThingsAndreas Ruppen
 
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptx
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptxSession 9 - Project scheduling-PERT-CPM-Network diagram.pptx
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptxAlRashedinKawser2
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Codemotion
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Codemotion
 

Similar to 05_ActivityDiagram_slides_2015.pptx (20)

Operation research's CPM techniques
Operation research's CPM techniques Operation research's CPM techniques
Operation research's CPM techniques
 
02_IT4557.pptx
02_IT4557.pptx02_IT4557.pptx
02_IT4557.pptx
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram model
 
DDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdfDDD - 2 - Domain Driven Design: Tactical design.pdf
DDD - 2 - Domain Driven Design: Tactical design.pdf
 
Attach Me, Detach Me, Assemble Me like you Work
Attach Me, Detach Me, Assemble Me like you WorkAttach Me, Detach Me, Assemble Me like you Work
Attach Me, Detach Me, Assemble Me like you Work
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
ETOS discrete event simulation framework focused on easier team cooperation
ETOS discrete event simulation framework focused on easier team cooperationETOS discrete event simulation framework focused on easier team cooperation
ETOS discrete event simulation framework focused on easier team cooperation
 
Lec 09 network scheduling_techniques
Lec 09 network scheduling_techniquesLec 09 network scheduling_techniques
Lec 09 network scheduling_techniques
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD ppt
 
Os2 2
Os2 2Os2 2
Os2 2
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
 
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. LaukePointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
Pointer Events Working Group update / TPAC 2023 / Patrick H. Lauke
 
Master Thesis Presentation
Master Thesis PresentationMaster Thesis Presentation
Master Thesis Presentation
 
lec01_VT22.pdf
lec01_VT22.pdflec01_VT22.pdf
lec01_VT22.pdf
 
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...
EDOC 2013 "Event Actors Based Approach for Supporting Analysis and Verificati...
 
A component based architecture for the Web of Things
A component based architecture for the Web of ThingsA component based architecture for the Web of Things
A component based architecture for the Web of Things
 
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptx
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptxSession 9 - Project scheduling-PERT-CPM-Network diagram.pptx
Session 9 - Project scheduling-PERT-CPM-Network diagram.pptx
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
 
uml.ppt
uml.pptuml.ppt
uml.ppt
 

Recently uploaded

Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Recently uploaded (20)

Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

05_ActivityDiagram_slides_2015.pptx

  • 1. Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna, Austria phone: +43 (1) 58801-18804 (secretary), fax: +43 (1) 58801-18896 office@big.tuwien.ac.at, www.big.tuwien.ac.at Object-Oriented Modeling Activity Diagram Slides accompanying UML@Classroom Version 1.0
  • 2. © BIG / TU Wien Literature  The lecture is based on the following book:  Use Case Diagram  Structure Modeling  State Machine Diagram  Sequence Diagram  Activity Diagram UML @ Classroom: An Introduction to Object-Oriented Modeling Martina Seidl, Marion Scholz, Christian Huemer and Gerti Kappel Springer Publishing, 2015 ISBN 3319127411 2
  • 3. © BIG / TU Wien Content  Introduction  Activities  Actions  Edges  Control flow  Object flow  Initial node, activity final node, flow final node  Alternative paths  Concurrent paths  Object nodes  Event-based actions and call behavior actions  Partitions  Exception handling 3
  • 4. © BIG / TU Wien Introduction  Focus of activity diagram: procedural processing aspects  Flow-oriented language concepts  Based on  languages for defining business processes  established concepts for describing concurrent communicating processes (token concept as found in petri nets)  Concepts and notation variants cover broad area of applications  Modeling of object-oriented and non-object-oriented systems 4
  • 5. Activity  Specification of user-defined behavior at different levels of granularity  Examples:  Definition of the behavior of an operation in the form of individual instructions  Modeling the course of actions of a use case  Modeling the functions of a business process  An activity is a directed graph  Nodes: actions and activities  Edges: for control and object flow  Control flow and object flow define the execution  Optional:  Parameter  Pre- and postconditions Input parameter Node Edge Output parameter 5
  • 6. © BIG / TU Wien Action  Basic element to specify user-defined behavior  Atomic but can be aborted  No specific rules for the description of an action Definition in natural language or in any programming language  Process input values to produce output values  Special notation for predefined types of actions, most importantly  Event-based actions  Call behavior actions 6
  • 7. © BIG / TU Wien  Connect activities and actions to one another  Express the execution order  Types  Control flow edges  Define the order between nodes  Object flow edges  Used to exchange data or objects  Express a data/causal dependency between nodes  Guard (condition)  Control and object flow only continue if guards in square brackets evaluate to true Edges Object flow Control flow 7
  • 8. © BIG / TU Wien Token  Virtual coordination mechanism that describes the execution exactly  No physical component of the diagram  Mechanism that grants the execution permission to actions  If an action receives a token, the action can be executed  When the action has completed, it passes the token to a subsequent action and the execution of this action is triggered  Guards can prevent the passing of a token  Tokens are stored in previous node  Control token and object token  Control token: “execution permission" for a node  Object token: transport data + “execution permission” 8
  • 9. © BIG / TU Wien Beginning and Termination of Activities  Initial node  Starts the execution of an activity  Provides tokens at all outgoing edges  Keeps tokens until the successive nodes accept them  Multiple initial nodes to model concurrency  Activity final node  Ends all flows of an activity  First token that reaches the activity final node terminates the entire activity  Concurrent subpaths included  Other control and object tokens are deleted  Exception: object tokens that are already present at the output parameters of the activity  Flow final node  Ends one execution path of an activity  All other tokens of the activity remain unaffected 9
  • 10. © BIG / TU Wien Alternative Paths – Decision Node  To define alternative branches  „Switch point“ for tokens  Outgoing edges have guards  Syntax: [Boolean expression]  Token takes one branch  Guards must be mutually exclusive  Predefined: [else]  Decision behavior  Specify behavior that is necessary for the evaluation of the guards  Execution must not have side effects 10
  • 11. © BIG / TU Wien Alternative Paths – Merge Node  To bring alternative subpaths together  Passes token to the next node  Combined decision and merge node  Decision and merge nodes can also be used to model loops: 11
  • 12. © BIG / TU Wien Example: Alternative Paths 12
  • 13. © BIG / TU Wien Concurrent Paths – Parallelization Node  To split path into concurrent subpaths  Duplicates token for all outgoing edges  Example: 13
  • 14. © BIG / TU Wien Concurrent Paths – Synchronization Node  To merge concurrent subpaths  Token processing  Waits until tokens are present at all incoming edges  Merges all control tokens into one token and passes it on  Passes on all object tokens  Combined parallelization and synchronization node: 14
  • 15. © BIG / TU Wien Example: Equivalent Control Flow … equivalent to … 15
  • 16. © BIG / TU Wien Example: Create and Send Invitations to a Meeting  While invitations are printed, already printed invitations are addressed.  When all invitations are addressed, then the invitations are sent. 16
  • 17. Example: Conduct Lecture (Student Perspective) 17 NOT equivalent … why?
  • 18. … the first token that reaches the activity final node terminates the entire activity … a parallelization node duplicates an incoming token for all outgoing edges … a decision node passes the token to one outgoing edge (depending on the result of the evaluation of the guard) … if all incoming edges of an action have a token, the action is activated and is ready for execution … all outgoing edges of all initial nodes are assigned a token…. … a merge node individually passes each token it gets to its outgoing edge … a synchronization node waits until all incoming edges have a token, merges them to a single token and passes it to its outgoing edge … before the execution, the action consumes one token from every incoming edge; after the execution, the action passes one token to every outgoing edge Example: Token (Control Flow) x x x x x x x x x x x x x x x x x End ! x x 18
  • 19.  Contains object tokens  Represents the exchange of data/objects  Is the source and target of an object flow edge  Optional information: type, state  Notation variant: object node as parameter  For activities  For actions (“pins”) Object Node Input parameter Output parameter 19
  • 20. © BIG / TU Wien Example: Object Node 20
  • 21. © BIG / TU Wien Central Buffer  For saving and passing on object tokens  Transient memory  Accepts incoming object tokens from object nodes and passes them on to other object nodes  When an object token is read from the central buffer, it is deleted from the central buffer and cannot be consumed again 21
  • 22. © BIG / TU Wien Data Store  For saving and passing on object tokens  Permanent memory  Saves object tokens permanently, passes copies to other nodes 22
  • 23. © BIG / TU Wien Weight of Edges  Minimal number of tokens that must be present for an action to be executed  Default: 1  All tokens present have to be consumed: 0 (also all or *) 23
  • 24. © BIG / TU Wien Connector  Used if two consecutive actions are far apart in the diagram  Without connector:  With connector 24
  • 25. Event-Based Actions  To send signals  Send signal action  To accept events  Accept event action  Accept time event action 25
  • 26. © BIG / TU Wien Example: Accept Event Action 26
  • 27. © BIG / TU Wien Call Behavior Action  The execution of an action can call an activity  Content of the called activity can be modeled elsewhere  Advantages:  Model becomes clearer  Reusability Name of the called activity Inverted fork symbol 27
  • 28. © BIG / TU Wien Partition  “Swimlane”  Graphically or textual  Allows the grouping of nodes and edges of an activity due to responsibilities  Responsibilities reflect organizational units or roles  Makes the diagram more structured  Does not change the execution semantics  Example: partitions Student and Institute Employee (with subpartitions Professor and Secretary) 28
  • 29. © BIG / TU Wien Example: Partitions 29
  • 30. © BIG / TU Wien Multidimensional Partitions  Graphical notation … or alternatively textual notation 30
  • 31. Example: Issue Student ID on Paper (1/2)  State machine diagram of Student ID:  Activity diagram – control flow: 31
  • 32. Example: Issue Student ID on Paper (2/2)  Control flow (green) and object flow (red) in one activity diagram 32
  • 33. © BIG / TU Wien Exception Handling – Exception Handler  Predefined exceptions  Defining how the system has to react in a specific error situation  The exception handler replaces the action where the error occurred  If the error e occurs…  All tokens in Action A are deleted  The exception handler is activated  The exception handler is executed instead of Action A  Execution then continues regularly 33
  • 35. © BIG / TU Wien Exception Handling– Interruptible Activity Region  Defining a group of actions whose execution is to be terminated immediately if a specific event occurs. In that case, some other behavior is executed  If E occurs while B or C are executed  Exception handling is activated  All control tokens within the dashed rectangle (= within B and C) are deleted  D is activated and executed  No “jumping back” to the regular execution! 35
  • 36. © BIG / TU Wien Example: Interruptible Activity Region 36
  • 37. © BIG / TU Wien Name Notation Description Action node Activity node Represents an action (atomic!) Represents an activity (can be broken down further) Initial node Start of the execution of an activity Activity final node End of ALL execution paths of an activity Notation Elements (1/5) 37
  • 38. © BIG / TU Wien Notation Elements (2/5) Name Notation Description Decision node Merge node Splitting of one execution path into alternative execution paths Merging of alternative execution paths into one execution path Parallelization node Synchronization node Splitting of one execution path into concurrent execution paths Merging of concurrent execution paths into one execution path 38
  • 39. © BIG / TU Wien Name Notation Description Flow final node End of ONE execution path of an activity Edge Connection between the nodes of an activity Call behavior action Action A refers to an activity of the same name Partition Grouping of nodes and edges within an activity Notation Elements (3/5) 39
  • 40. © BIG / TU Wien Notation Elements (4/5) Name Notation Description Send signal action Transmission of a signal to a receiver Asynchronous accept (timing) event action Wait for an event E or a time event T Object node Contains data or objects Parameter for activities Parameter for actions (pins) Contains data and objects as input and output parameters 40
  • 41. © BIG / TU Wien Notation Elements (5/5) Name Notation Description Exception Handler Exception handler is executed instead of the action in the event of an error e Interruptible activity region Flow continues on a different path if event E is detected 41