Activity Diagram
It represents workflows and the sequence of activities. It define what activities user perform during a use case.
Each use case in a use case diagram can be further explored by creating an activity diagram. It's common to create an activity diagram for each use case identified in the use case diagram.
Components:
- Activities: Represent tasks or actions performed in the workflow. Each activity is denoted by a rounded rectangle.
- Start Node: Indicates the beginning of a process. It is represented by a filled black circle.
- End Node: Marks the end of the process flow. It is represented by a black circle with a surrounding border.
- Transitions/Arrows: Arrows show the flow or transition from one activity to the next.
- Decision Node: Depicted as a diamond shape, it represents branching in the workflow based on conditions. Each outgoing arrow is labeled with a condition.
- Merge Node: A diamond shape without conditions where multiple flows join back together.
- Fork Node: Represented as a thick horizontal or vertical line, it splits a single flow into multiple parallel flows.
- Join Node: A thick line that synchronizes multiple parallel flows into a single flow.
- Swimlanes: Vertical or horizontal partitions used to organize activities by the responsible actors or departments. This helps in visually associating actions with particular actors.
Example
+-------------------------+ +---------------------+ +---------------------+
| Start |-->| Search Book |-->| Book Available? |
+-------------------------+ +---------------------+ +---------+-----------+
| |
| v
| +---------------------+
| | Book Not Available |
| | Notify User |
| +---------------------+
| |
| v
| +---------------------+
| | End |
| +---------------------+
|
v
+-------------------------+ +---------------------+ +---------------------+
| Verify Membership |-->| Valid Member? |-->| Borrow Book |
+-------------------------+ +---------+-----------+ +---------------------+
|
| +---------------------+
| | Record Borrowing |
v +---------------------+
+---------------------+ |
| Not a Member | |
| Notify User | v
+---------------------+ +---------------------+
| | Issue Receipt |
v +---------------------+
+------------------+ |
| End |<-------------+
+------------------+