What is a UML activity diagram?
What are the Basic Activity Diagram notations?
Symbols for diagram?
What is the purpose?
How to draw with an example?
Where to use?
Advantages and Disadvantages of activity diagram?
UML Activity Diagram
An activity diagram is one of the important diagrams in UML. It is used to describe the dynamic aspects of the system. This diagram is a visual representation of a series of actions or flow of control in a system. It is similar to a flowchart or a data flow diagram. This diagram is often used in business process modeling. It can also be used to describe the steps in the use case diagram. This diagram can be sequential or concurrent. In both cases, the diagram will have an initial state and a final state. There are two ways to depict activities, guards, flows, decisions, merge, time events and more.
Initial state / Start point:
In this diagram, a small filled circle which is followed by an arrow represents the initial activation state for any activity diagram. The use of swimlanes makes sure that the start point is placed in the top left corner of the very first column.
Activity / Action state:
An action state is used to represent the non-interruptible actions of objects. We can draw an action state in Smart Draw using a rectangle with rounded corners. In simple, a rectangle with a rounded circle is used to represent the activity in an activity diagram.
Action flow is also called the edge of the paths. It is used to illustrate the transition from one action state to another action state. They are drawn with an arrowed line as shown below.
Object flow arrow from action to an object shows that the action creates or influences the object. The object flow arrow from an object to action shows that the active state uses the object.
Decision and branching:
A diamond symbol is used to represent the decision with alternate paths. If a decision is required in an activity diagram, a diamond symbol is added between the two activities. One of the paths can be labeled as “else”.
Guards are the statements that are written next to a decision diamond that must be true before moving next to the next activity. Guards are not essential but they are useful when a specific answer is needed.
It is represented as a straight line in this diagram. A join node is used to join multiple concurrent flows back into a single outgoing flow. A fork and join mode are used together and are referred to as synchronization.
The hourglass is used to represent to time event. It refers to an event that stops the flow for a time.
A merge event is used to bring together the multiple flows that are not concurrent.
Sent and received signals:
These signals appear in pairs. It is because the state cannot change until the response is received.
This is represented by a lightning bolt. It denotes events like cancellation that interrupts.
It groups the related activities into one column.
What is the purpose of an activity diagram?
The purpose of an activity diagram is described as –
- Draw the activity flow of an entire system
- It tells the sequence from one activity to another activity of a system.
- Describe the parallel, branched and the concurrent flow of an entire system.
How to draw an activity diagram
Before we draw diagrams, we should identify the following elements clearly:
After we have identified all the above elements, we make a mental layout of the flow. This layout is transformed into this diagram.
Here is an example of this diagram of the order management system.
Note: An activity diagram cannot be matched with the code exactly.
It is made just to understand the flow of activities and used by business users mostly.
The above example diagram will be drawn with the four main activities:
- Send order by the customer.
- Receipt of that order.
- Confirmation of the order.
- Dispatch the order.
After that, the conditions are checked if it is a normal or special order. After this identification, dispatch activity is performed and marked as the termination of the process.
Where to use an activity diagram
The basic use of this diagram is similar to other UML diagrams. But this diagram can be used for the following reasons:
- Modeling the flow of work by using activities.
- Modeling requirements of the business.
- High-level understanding of functionalities of the system.
- Investigating the requirements of a business at a later stage.
Advantages of the activity diagram
- It is easily understood.
- It is easy to draw.
- It is a complete description of a system.
- It gives a complete representation of a system.
- It is very useful for business users.
Disadvantages of activity diagram
- It is not secure.
- It includes no security aspects.
- It has no usage guidance.
- It cannot match the exact code of a system.
- The activity diagram has many symbols to remember.
Here are some other article that you must read