Activity diagram
Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams are intended to model both computational and organizational processes (i.e., workflows), as well as the data flows intersecting with the related activities. Although activity diagrams primarily show the overall flow of control, they can also include elements showing the flow of data between activities through one or more data stores.
Construction
Activity diagrams are constructed from a limited number of shapes, connected with arrows. The most important shape types:
- ellipses represent actions;
- diamonds represent decisions;
- bars represent the start (split) or end (join) of concurrent activities;
- a black circle represents the start (initial node) of the workflow;
- an encircled black circle represents the end (final node).
Arrows run from the start towards the end and represent the order in which activities happen.
Activity diagrams can be regarded as a form of a structured flowchart combined with a traditional data flow diagram. Typical flowchart techniques lack constructs for expressing concurrency. However, the join and split symbols in activity diagrams only resolve this for simple cases; the meaning of the model is not clear when they are arbitrarily combined with decisions or loops.
While in UML 1.x, activity diagrams were a specialized form of state diagrams, in UML 2.x, the activity diagrams were reformalized to be based on Petri net-like semantics, increasing the scope of situations that can be modeled using activity diagrams. These changes cause many UML 1.x activity diagrams to be interpreted differently in UML 2.x.
UML activity diagrams in version 2.x can be used in various domains, e.g. in design of embedded systems. It is possible to verify such a specification using model checking technique.
Activity Diagrams consist of activities, states and transitions between activities and states
Activity Diagrams describe
- how activities are coordinated to provide a service
- the events needed to achieve some operation
- how the events in a single use case relate to one another
- how a collection of use cases coordinate to create a workflow for an organisation
Activities
An Activity is a process being modeled
• Activities are the vertices of the diagram
• An Activity is a unit of work that needs to be carried out
• Any Activity takes time
• An activity is like a state where the criterion for leaving the state is the completion of the activity
Actions
• An Action is a step in the overall activity
• The work can be documented as Actions in the activity
• There are four ways in which an action can be triggered
- On Entry – as soon as the activity starts
- Do – during lifetime of the activity
- On Event – in response to an event
- On Exit – just before the activity completes
Transitions
• A Transition is the movement from one activity to another, the change from one state to another, or the movement between a state and an activity in either direction
• Transitions: unlabelled arrows from one activity to the next
• Transitions take place when one activity is complete and the next can commence
Activity Edges
• The flow of an activity is shown using arrowed lines called edges or paths
• Control-flow Transitions indicate the order of action states
• Object-flow Transitions indicate that an action state inputs or outputs an object
Tokens
• Conceptually, UML models information moving along an edge as a token (e.g., real data, an object or focus of control)
• Each edge may have
– a weight associated with it that indicates how many tokens must be available before the tokens are presented to the target action
– a guard condition