Object-oriented modeling Activity diagrams

22
Object-oriented modeling Activity diagrams Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”

description

Object-oriented modeling Activity diagrams. Karolina Muszyńska. Based on : S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”. Object Modeling. Dynamic view – activity diagrams role basic concepts advanced concepts examples. Activity Diagrams – role. - PowerPoint PPT Presentation

Transcript of Object-oriented modeling Activity diagrams

Page 1: Object-oriented modeling Activity diagrams

Object-oriented modeling

Activity diagrams

Karolina Muszyńska

Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”

Page 2: Object-oriented modeling Activity diagrams

Dynamic view – activity diagrams◦ role◦ basic concepts◦ advanced concepts◦ examples

2

Object Modeling

Page 3: Object-oriented modeling Activity diagrams

Activity Diagrams – a kind of UML diagrams describing the dynamics of the system. They graphically describe the sequential and/or parallel control flows and data flows among orderly arranged activities, actions and objects.

Activity diagrams show the workflow from a start point to the finish point detailing the many decision paths that exist in the progression of events contained in the activity.

Activity diagrams are useful for business modeling where they are used for detailing the processes involved in business activities.

3

Activity Diagrams –role

Page 4: Object-oriented modeling Activity diagrams

Activity - activity represents a business process; fundamental elements of the activity are actions and control elements (decision, division, merge, initiation, end, etc.)

Elements are connected by so-called “activity edges” and form the “control flow” or ‘flow’. The execution of an activity can contain parallel flows.

Edge (Control Flow) - edges, represented by arrows, connect the individual components of activity diagrams and illustrate the control flow of the activity. A name can be attached to an edge.

4

Activity Diagrams –basic concepts

Page 5: Object-oriented modeling Activity diagrams

Action is an individual step within an activity. The action can possess input and output information. Specific actions are calling other actions, receiving an event, and sending signals.

Initial Node - the initial node is the starting point of an activity. Usually there is only one initial node but in complex real-time systems there may be more initial nodes, which means that several flows start at the beginning of an activity. It is also possible that an activity has no initial node, but is initiated by an event.

5

Activity Diagrams – basic concepts

Page 6: Object-oriented modeling Activity diagrams

Activity Final Node - the activity final node indicates that an activity is completed. An activity diagram can have more than one exit in the form of activity final nodes. If several parallel flows are present within an activity, all flows are stopped at the time the activity final node is reached.

Flow Final Node - a flow final node terminates a flow. Unlike the activity final node, which ends an entire activity, reaching a flow final node has no effect on other parallel flows that are being processed within the activity at the same point in time. In this way, parallel flows can be terminated individually and selectively.

6

Activity Diagrams – basic concepts

Page 7: Object-oriented modeling Activity diagrams

7

Activity Diagrams –basic conceptsInitial Node

Activity Final Node

ActivityActivity

Edge/Control Flow

Page 8: Object-oriented modeling Activity diagrams

Decision Node – a conditional branch point or decision node, represented by a diamond. A decision node has one input and two or more outputs. Each output has a condition attached to it, which is written in brackets. If a condition is met, the flow proceeds along the appropriate output. An ‘else’ output can be defined along which the flow can proceed if no other condition is met.

Merge Node - a diamond which has several inputs and only one output. Its purpose is the merging of flows. The inputs are not synchronized; if a flow reaches such a node it proceeds at the output without waiting for the arrival of other flows. 8

Activity Diagrams – advanced concepts

Page 9: Object-oriented modeling Activity diagrams

9

Activity Diagrams – examples

Decision Node

Decomposed activity

Page 10: Object-oriented modeling Activity diagrams

10

Activity Diagrams – advanced concepts

Activity diagram for

the decomposed

activity

Merge Node

Page 11: Object-oriented modeling Activity diagrams

Fork - for the branching of flows in two or more parallel flows we use a synchronization bar, which is depicted as a thick horizontal or vertical line. Branching allows parallel flows within activities. A fork has one input and two or more outputs.

Join - for the consolidation of two or more parallel flows we also use a synchronization bar, which is depicted as a thick horizontal or vertical line. During consolidation synchronization takes place, meaning the flow proceeds only after all incoming flows have reached the consolidation point. Join has two or more inputs and one output.

11

Activity Diagrams – advanced concepts

Page 12: Object-oriented modeling Activity diagrams

Data flow – flow of data between an object and activities or actions effecting this object. Objects and data flows are inserted within an activity diagram in the following situations:◦ we want to indicate the responsibility of an object,◦ we want to depict the flow of the object,◦ the state of the object is changed.

12

Activity Diagrams – advanced concepts

Page 13: Object-oriented modeling Activity diagrams

13

Activity Diagrams – advanced concepts

Fork

Join

Data flow

Object

Page 14: Object-oriented modeling Activity diagrams

Activity Partition - the individual elements of an activity diagram can be divided into individual areas or ‘partitions’. Various criteria can lead to the creation of these partitions: organization entities, cost centers, locations, etc. Individual steps of an activity will be assigned to these partitions. Each partition is set apart from its neighboring partition by a horizontal or vertical continuous line; from this stems the term swim lanes. Each partition receives a name. Partitions can be arranged in a two-dimensional manner; in this case the activity diagram is divided into individual cells like a grid.

14

Activity Diagrams – advanced concepts

Page 15: Object-oriented modeling Activity diagrams

15

Activity Diagrams – advanced concepts

Activity partitions

Page 16: Object-oriented modeling Activity diagrams

Call Activity Action - an activity can be called from within another activity. Calling, in itself, is an action; the outcome of the call is another activity. In this way, activities can be nested within each other and can be represented with different levels of detail.

Accept Event Action - this action waits for an event to occur. After the event is accepted, the flow that comes from this action (and is defined in the activity diagram) is executed. Many business processes are initiated by events, for example, processing an order by the receipt of an order, or delivery by the receipt of a payment.

16

Activity Diagrams – advanced concepts

Page 17: Object-oriented modeling Activity diagrams

Accept Time Event Action - at a definite point in time, this action starts a flow in the activity diagram. An hourglass symbol can be used to represent the acceptance of a time event. A typical example of a time event is triggering reminders after the deadline for payment has passed.

Send Signal Action – is an action that creates a signal which is sent to an accepting activity. The accepting activity accepts the signal with the action “accept an event” and can react accordingly, meaning according to the flow that originates from this node in the activity diagram.

17

Activity Diagrams – advanced concepts

Page 18: Object-oriented modeling Activity diagrams

Expansion Region - is a structured activity region (defined fragment of a diagram), with clearly specified inputs and outputs, performed repeatedly, accordingly to the number of elements in the input.

Interruptible Activity Region - surrounds a group of actions that can be interrupted, as a result of the interruption flow.

Exception handler - outlines the activities that should be executed if the specified exception occurs during execution of a protected action.

18

Activity Diagrams – advanced concepts

Page 19: Object-oriented modeling Activity diagrams

19

Activity Diagrams – advanced concepts

Expansion region

Page 20: Object-oriented modeling Activity diagrams

20

Activity Diagrams – advanced concepts

Interruptible Activity Region

Exception handler

Except event action

Except time event action

Page 21: Object-oriented modeling Activity diagrams

21

Building an Activity Diagram Identification of basic activities based on use

case scenario, Connecting activities using control flows, Optional decomposition of activities, Identification of decision flows and parallel

control flows, Introduction of data flows, Identification of criteria and partitions of the

diagram, Introduction of expansion and interruptible

regions, Introduction of exception handlers.

Page 22: Object-oriented modeling Activity diagrams

22

Additional information and examples

UML Activity Diagrams: Guidelines https://msdn.microsoft.com/en-us/library/dd409465.aspx

UML Activity Diagrams: Reference https://

msdn.microsoft.com/en-us/library/dd409360.aspx

Activity Diagrams http://www.uml-diagrams.org/activity-diagrams.html

UML Activity Diagram Examples http://www.uml-diagrams.org/activity-diagrams-examples.html