Introduction


The focus of the activity diagram is the procedural processing aspects.

It uses flow-oriented language concepts and it is 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 a broad area of applications:

  • Modelling of object-oriented and non-object-oriented systems.

Activity


It is the specification of user-defined behaviour at different levels of granularity.

Example:

  • Definition of the behaviour of an operation in the form of individual instructions.
  • Modelling the course of actions of a use case.
  • Modelling the functions of a business process.

An activity is a directed graph:

  • Nodes: actions and activities.
  • Edges: for control and object flow.

The control flow and object flow define the execution.

Optional:

  • Parameter.
  • Pre and postconditions.

|350

Action


It has a basic element to specify user-defined behaviour.

It is atomic but can be aborted.

No specific rules for the description of an action. The definition is 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 behaviour actions.

Edges


It connects activities and actions to one another.

Express the execution order.

Types:

  • Control flow edges.
    • Defines 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.

|300

Token


It is a 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 trigged.

Guards can prevent the passing of a token, as they are stored in the previous node.

Control token: “execution permission” for a node.

Object token: transport data + “execution permission”.

|160

Beginning and Termination of Activities


|20 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.

|20 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.

|20 Flow final node:

  • Ends one execution path of an activity.
  • All other tokens of the activity remain unaffected.

Alternative Paths


|600

Decision Node


Used to defined alternative branches.

„Switch point“ for tokens.

Outgoing edges have guards:

  • Syntax: [Boolean expression].
  • Token takes one branch.
  • Guards must be mutually exclusive.
  • Predefined: [else].

|300

Decision behaviour:

  • Specify behaviour that is not necessary for the evaluation of the guards.
  • Execution must not have side effects.

|150

Merge Node


Used to bring alternative subpaths together. It passes the token to the next node.

Combined decision and merge node:

|100

Decision and merge nodes can also be used to model loops: |500

Concurrent Paths

Parallelisation Node


Used to split path into concurrent subpaths.

Duplicates token for all outgoing edges, example:

|500

Synchronisation Node


Used 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 parallelisation and synchronisation node: |70

Examples

Equivalent Control Flow


|600

Create and Send Invitations to a Meeting


While invitations are printed, already printed invitations are addressed.

When all invitation are addressed, then the invitations are sent.

|600

Conduct Lecture (Student Perspective)


|600

Token (Control Flow)


Object Node


It contains object tokens and represents the exchange of data/objects.

It is the source and target of an object flow edge.

Optional information: type and state.

|300

Notation variant: object node as parameter:

  • For activities: |500

  • For actions (“pins”): |500

Example


|600

Central Buffer


It is for saving and passing on object tokens.

Transient memory, it 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.

|600

Data Store


It is for saving and passing on object tokens.

Permanent memory, saves object tokens permanently and passes copies to other nodes.

|600

Weight of Edges


Minimal number of tokens that must be presented for an action to be executed.

Default: 1.

All tokens present have to be consumed: 0 (also all or *).

|500

Connector


Used if two consecutive actions are far apart in the diagram.

Without connector: |500

With connector: |500

Event-Based Actions


To send signals:

  • Send signal action: |500

To accept events:

  • Accept event action: |500

Accept time event action: |500

Example


|600

Call Behaviour Action


The execution of an action can call an activity.

Content of the called activity can be modelled elsewhere.

Advantages:

  • Model becomes clearer.
  • Reusability.

|600

Partition


“Swimlane”. Graphically or textual.

It allows the grouping of nodes and edges of an activity due to responsibilities.

Responsibilities reflect organisational units or roles.

Makes the diagram more structured.

Does not change the execution semantics.

Example:

  • partitions Student and Institute Employee (with sub-partitions Professor and Secretary).

|500

|500

Multidimensional Partitions


Graphical notation vs Textual notation:

|600

Example: Issue Student ID on Paper


|600

  • Control flow (green) and object flow (red) in one activity diagram: |600

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.

|200

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.

Example


|600

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 behaviour is executed.

|300

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!

Example


|500

Notation Elements


|600

|600

|600

|600

|600