Activity Diagram is a flowchart that depicts the flow of information from one activity to the next. A system operation can be used to describe the activity. The primary goal of activity diagrams is to depict the system’s dynamic behaviour. Object-oriented flowchart is another name for it.
Instead of focusing on implementation, this UML diagram focuses on the execution and flow of a system’s behaviour. Behavioral modelling technology is represented by activity diagrams, which are made up of actions.
Components of Activity Diagram
It’s a behaviour that’s broken down into one or more steps. Activities are a network of nodes with edges connecting them. Action nodes, control nodes, and object nodes are all possible. Some action is represented by action nodes. The control flow of an activity is represented by control nodes. Object nodes are used to describe the objects that are used within a given activity. Edges are used to depict a flow of execution or a path. The activities begin at the first node and end at the last node.
A swimlane or activity partition is a high-level grouping of a set of related actions. A single partition can refer to a variety of things, including classes, use cases, components, and interfaces.
If a partition cannot be seen clearly, its name is written on top of the name of an activity.
Fork and Join nodes:
Concurrent flows within an activity can be generated using fork and join nodes. A fork node has a single incoming edge and many outgoing edges. It’s the same as having too many decision parameters. When data arrives at an incoming edge, it is duplicated and distributed across multiple outgoing edges at the same time. A single incoming flow is split into several parallel flows.
A join node is the inverse of a fork node in that it has many incoming edges but only one outgoing edge. It applies the logical AND operation to all incoming edges. This allows you to synchronise the flow of input across a single output edge..
How Activity Diagram helps ?
In UML, you can create an event as an activity that consists of a collection of nodes connected by edges. To model its behaviour, an activity can be attached to any modelling element. Modeling is done using activity diagrams.
- Use Cases
Processes and workflows are represented using activity diagrams. A useful activity diagram’s essence is to communicate a specific aspect of a system’s dynamic behaviour. The dynamic elements of a system are captured in activity diagrams.
An activity diagram is similar to a flowchart in that it depicts the flow of information from one activity to the next. Although the activity diagram resembles a flowchart, it is not one. Various control elements in the UML flow diagram can be used to control the flow of activity. An activity diagram, in simple terms, is a diagram that depicts the flow of execution between multiple activities.
Activity Diagram Notations :
Initial Condition or Starting Point
The initial action state or starting point for any activity diagram is represented by a small filled circle followed by an arrow. When creating an activity diagram with swimlanes, make sure the start point is in the top left corner of the first column.
Activity or Action State
The non-interruptible action of objects is represented by an action state. In SmartDraw, you can create an action state by drawing a rectangle with rounded corners.
Transitions from one action state to another are depicted by action flows, also known as edges and paths. An arrowed line is usually used to represent them.
The creation and modification of objects by activities is referred to as object flow. This means that the action has created or influenced the object, as indicated by the object flow arrow from the action. If you see an object flow arrow from one object to another, that means the object is used in the action.
Decisions and Branching
A diamond represents a decision with multiple possible outcomes. Add a diamond between two activities when one requires a decision before moving on to the next. A conditional expression or a guard expression should be used to identify the alternates that are going to be sent out. Alternately, you can designate one of the paths as “other.”
To move on to the next activity in UML, guards are written next to a decision diamond. None of this is required, but it is useful when a specific answer is required before moving forward (e.g. “Yes, three labels have been printed”).
Final State or End Point
The final action state is represented by an arrow pointing to a filled circle nestled inside another circle.