Miro - What Is a UML Activity Diagram?

Article link: https://miro.com/diagramming/what-is-a-uml-activity-diagram/

Understanding activities and processes is a crucial part of improving them. Representing an activity graphically is often the easiest way to clarify it. However, creating a visual representation is itself a complicated task. With a UML activity diagram, you can use a consistent and well-understood method for creating a visual representation of workflows.

UML activity diagrams are a key tool in understanding how tasks are accomplished, and therefore how a business operates. Once you know how everything is done, an activity diagram may also provide insight on how to do it better.

As a result, creating an activity diagram is an important skill for any business person, or just anyone interested in improving how they do things.

Introduction to UML activity diagrams

An activity diagram is a visual representation of actions, constraints, requirements, and other factors that play into accomplishing tasks. You can think of them as a detailed flowchart, revealing each step and decision point in a process. Mapping out activities in this way can reveal new information, help identify inefficiencies, and provide other important benefits.

A UML activity diagram specifically uses the Universal Modeling Language in creating the diagram.

What is UML?

If you don’t already know, Universal Modeling Language is a standardized method of creating visual representations showing the relationships between different elements. While it was created as a software development tool, the business world has found many uses for it too. It provides a library of symbols and rules for representing relationships of different types.

An activity diagram is considered a type of behavioral diagram as opposed to a structural diagram. Essentially, that means that it represents a dynamic flow of what happens in the system rather than a static state.

What is an activity in UML?

Each component of an activity diagram is called an element. An activity is the highest-level element in the diagram. It’s not unusual for an activity diagram to focus on the constituent parts of just one activity. In that case, the diagram as a whole would represent the activity.

In a broader business and legal sense, an activity can mean anything that a business does in the pursuit of earning a profit or delivering some benefit. However, in the case of an activity diagram, the definition can be more fluid. It may be a component of a business process, an entire process, or some other set of dynamic relationships you’re interested in modeling. 

When to use a UML activity diagram

Essentially, a UML activity diagram is used whenever you need to represent the dynamic flow of relationships that make up a business activity. It can be a physical process, with elements representing workers, managers, and systems, or customers and systems. As it was originally developed to represent software functionality, it also represents the more abstract relationships of a piece of software.

You can use a UML activity diagram to:

  • Track the logic of an algorithm, such as a function. 

  • Represent the steps in a UML use case.

  • Model a business process or workflow.

  • Describe the flow of actions for any activity.

They’re helpful in the planning stage to clarify an expected workflow. An activity diagram is also useful during operations or once a project is complete, to help you understand an existing process or even improve it.

Key components of an activity diagram

Several components make up activity diagrams, defined in Universal Modeling Language.

  • Action - An action represents a single step within an activity. They are usually represented by rectangles with rounded corners. 

  • Start Node - The starting point or triggering event for the activity. Usually represented by a solid black circle.

  • End Node - The final step in the activity, when the dynamic flow ends or is picked up by another activity. Usually represented by a solid black circle within a larger white circle.

  • Control node - An element that coordinates the flow between other nodes. The most common example may be a decision node, which chooses between outgoing flows, depending on set conditions. It’s usually represented by a diamond with one input flow and two or more output flows.

  • Control flows - Also known as control edges. Represents the directed flow of control from one element to another. Usually represented by a solid line.

  • Object flows - Also known as object edges. Represents the directed flow of objects from one element to another. Usually represented by a dotted line.

  • Activity partition - A column or row that’s used to show areas of responsibility for different actors. May be more commonly known as a swimlane.

Note that this is only a small selection of the components you can use in an activity diagram. UML offers a complete ‘language’ for representing activities, so it contains a full vocabulary of different diagram elements.

Similar types of UML diagrams

While activity diagrams may be one of the most common uses of UML, it can actually visually represent a wide variety of concepts. Other common behavioral UML diagrams are the use-case diagram and the sequence diagram.

While they are of a similar type to activity diagrams, they’re used for different purposes and are visually distinct.

Activity Diagram vs Use Case Diagram

An activity diagram describes a flow of system-to-system activity, but depending on its design, may not address users or actors at all. A use case diagram, on the other hand, is concerned primarily with users and how they interact with a system.

The classic example of a use case diagram may detail how users interact with an app. For example, a diagram for a shopping app might depict users’ options, including searching for new clothes, selecting the clothes they want, paying for them, selecting shipping options, etc. 

Sequence Diagram vs Activity Diagram

 An activity diagram shows the process flow of messages from system activity to activity, and contains conditional flows, loops and concurrent activities. 

On the other hand, a sequence diagram shows the order, sequenced by time, of messages flowing from one object to another.  As the name implies, the focus is on the sequence over time. 

Creating a UML activity diagram

Familiarity with the Universal Modeling Language is important for using it. As with any language, the more fluent you become, the more information you can convey. 

However, as you’ll see in our examples below, you can get started with just a few basic symbols. More importantly, it’s important to understand the activity you’re modeling.

Ideally, you could sit at your desk and consult a straightforward summary of an activity that clearly lists each element and relationship. However, an activity diagram is often used to help spot gaps in understanding of an activity. Collecting relevant data is therefore a step that can occur at any point in this process.

To make life a little easier, Miro offers a UML activity diagram template, offering all the components you’ll need to visually represent an activity.

Identify elements and actions

You may not have a full understanding of an activity before you start. After all, you probably wouldn’t need the activity diagram if you did. However, you usually have some idea of how an activity is performed, the actions involved, the resources required, and so forth. 

If nothing else, you usually know the starting state, triggering event, or end point of the activity. Using that, it’s possible to begin identifying other elements. It may not be vital to note every single detail in your diagram, as the goal is to represent the flow of an activity so it can be adequately understood. Too much detail may add confusion rather than dispelling it.

Determine the relationship between elements

Start mapping the relationships between actions, decision points, actors, and other elements in the diagram. Note that UML will use different components to represent different types of relationships, so try to find the component that best represents the relationship. 

For example, a decision node is used when there’s a condition that determines how activity flows among several options. A fork, on the other hand, represents a relationship where activity flows along two paths at the same time.

An important aspect of creating an activity diagram is to identify decision nodes, guards, and other constraints or requirements for the activity. These elements often represent key aspects of the activity, such as user inputs, resource constraints, deadlines, or completed actions.

Organize diagram elements

Once you have all the important elements and relationships in place, you can create the diagram. The tools that Miro offers make it easy to find the correct symbol in UML to represent each element and relationship. 

Checking your work is always a good idea. Once your diagram is complete, trace the flow from the start node to each end state. Doing so guarantees that the activity diagram accurately represents the activity you’re interested in. 

It may take a couple of tries to represent relationships in a useful way, while also accurately representing the flow of activity. The more information you add, the more complicated it is to clearly represent the flow. 

UML activity diagram examples

There are a lot of technical terms and abstract concepts that go into creating UML activity diagrams, so much so that you may be feeling overwhelmed. While it helps to understand the terminology and concepts underlying UML activity diagrams, in practice they’re fairly intuitive to use.

Check out these examples to see the different elements in “action,” so that you can better build your own UML activity diagram.

Examples of an activity diagram

Basic example

(Image Source)

This is a fairly basic example of a UML activity diagram, showing a starting node and two ending nodes. You can see two decision nodes, represented by diamonds with at least one inflow and two outflows. A guard accompanies each out-flow from a decision node, which shows the condition for each option.

One or two key words simply describe each action, with one or two key words, even those that are fairly complex in practice. Some actions could be broken down into several steps. For example, the ‘modify proposal’ action could be represented by its own activity diagram. However, that’s outside the scope of this specific model.

Note that this example contains one fork after the second decision node. This represents two branches of the activity that happen simultaneously, as the proposal returns to the modify action at the same time relevant stakeholders are notified of the need for modifications.

Complicated example

(Image Source)

This is a slightly more complicated example that includes one start node and one end node. Like the simpler example, it contains just two decision nodes. However, it also contains a fork that describes both shipping the order and soliciting payment. The two concurrent flows of activity meet again in a join, just before the final action in which the order is closed.

Complicated example with swimlanes

(Image Source)

While this example has a slightly different appearance, it models the same activity in the complex activity example shown above. However, it includes more information as it adds activity partitions, perhaps better known as swimlanes. 

This activity includes three actors: the order department, the accounting department, and the customer. Each action is in a separate swimlane, corresponding to the actor that performs the action. Actions that are on the borders between swimlanes require input from more than one actor.

Swimlanes may be used in several different ways. In fact, both horizontal and vertical partitions may be used, creating a grid that shows shared areas of responsibility.

Create your own UML activity diagram

There’s a lot of technical jargon that goes into understanding UML activity diagrams. It may seem overly complicated, but the precise terms are actually used to prevent confusion and provide clarity for both technical and business users. 

In practice, activity diagrams can actually be quite intuitive to use. Once you start using them and see the benefits they can provide, you may be tempted to diagram all sorts of activities, in both your personal and business life.

Next
Next

Paradise Media - Testosterone Killing Foods