Architecture · Software

UML Activity Diagram

In a UML activity diagram, you represent the control flow from one activity to another in software system (like a levels in video game). You can consider activities as actions that further the flow of execution in a system. They are actions, that when completed, cause another action to execute. For example these actions can alter objects or create new objects. These changes/actions drive the application forward.

The purpose of the activity diagram is to capture the dynamic behaviour of the system. The activity diagram allows you to map out the branching into alternative flows.

When creating the diagram, firstly have to identify the activities.

Activity diagram have 2 major parts, the start and end nodes:

Start and End nodes.png
The start and end nodes

The intermediate activities are shaped as a pill. They describe all of the activities that change the game state before the game ends.

Intermediate Activity.png
The intermediate activity

This example shows a decision node which has 2 alternative outcomes as the next activity:

Activity Diagram.png

Detailed activity diagram:

Activity Diagram Example.png

Partitions divide activities up into different categories, such as where it occurs, or the user role involved. For example, all of the video game activities concerning levels could be grouped in one partition, and all of the player activities could be grouped in another partition. Swim lanes are used in an activity diagram to display these partitions.

Arrows crossing each lane show you how different activities of your system interact across the partitions.

Activity Diagram Partitions.png

Activity diagrams allow you to map out the high level behavior of a system. They do not care about implementation or code, and merely focus on the control flow between actions. With these diagrams, you can pinpoint exactly what activities and conditions should be included, and get a better idea of the order in which features are encountered, while still taking into account, alternative flows for your system.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.