The activity diagram is another common tool used by UML to model the dynamic behavior of the system. It describes the activity sequence and shows the control flow from one activity to another. An activity chart is essentially a flow chart. The activity diagram focuses on the control flow from one activity to another. It is an internal processing-driven process. The following is a detailed activity diagram:
I. basic elements:
1. Action state)
• Action status refers to the State in which an atomic and non-disruptive action is executed and switched to another state after the action is completed.
The action State is represented by a smooth rounded rectangle, and the Action indicated by the action state is written inside the rounded rectangle.
2. activity state)
• The active state is used to express the running of a non-atomic state machine.
• The icon in the active State is also a smooth rounded rectangle, and information such as the entrance and exit actions can be provided in the icon.
• Activity Status features:
The activity status can be divided into other sub-activities or action states. Because it is a combination of uninterruptible actions or actions, it can be interrupted.
Internal activities in the activity status can be represented by another activity diagram.
Unlike the action status, the activity status can be either an entry action or an exit action or an internal switch.
Action status is a special case of activity status. If an activity status only includes one action, it is an action status.
3. Action Flow)
The conversion flow between all action states is called an action flow.
• The conversion of an activity chart is indicated by a straight line with an arrow. The direction of the arrow points to the direction of transfer.
4. Branch and merge)
• A branch is generally used to indicate the conditional behavior of an object class.
• Conditional behavior is expressed by branch and merge.
• Branch and merge in the activity diagram are represented by a small hollow diamond.
• A branch has an inbound conversion and two conditional outbound conversions. The output conversion conditions should be mutually exclusive, so that only one outbound conversion can be triggered.
• A merge has two conditional-based inbound conversions and one output conversion. The merge ends the conditional behavior starting from the corresponding branch.
5. Fork and join)
• Forks are used to divide action streams into two or more concurrent branches, while Confluence is used to synchronize these concurrent branches to accomplish a transaction together.
• Forks can be used to describe concurrent threads. Each forks can have one input conversion and two or more output conversions, each of which can be an independent control flow.
• Confluence means that two or more concurrent control flows are synchronized. When all the control flows reach the confluence, the control can continue. Each confluence can have two or more input transformations and one output conversion.
Both the forking and confluence are expressed by a bold horizontal line segment.
6. Lane)
• The swimming track divides activity Graphs into several groups, and assigns each group to the business organization responsible for this group of activities, that is, the object.
• The swimming track distinguishes the objects in charge of activities and clearly indicates which activities are conducted by which objects.
• Each activity can only clearly belong to one swimming Lane.
• The swimming channels are drawn using vertical solid lines, and the areas separated by vertical lines are the swimming channels. At the top of a swimming track, you can give the name of the swimming track or the name of an object (Object Class). This object (Object Class) is responsible for all the activities in the swimming track.
There is no sequence in the swimming Lane. Activities in different swimming lanes can be performed sequentially or concurrently. Action streams and object streams can pass through the separation line.
7. Object Flow)
• The object stream is the dependency between the action status or activity status and the object, indicating the impact of the action on the object using the object or action.
• Object Features in an object stream: an object can be manipulated by multiple actions; an object output by one action can be input by another action.
Object streams are represented by dotted lines with arrows. If the arrow points to the object from the action state, it indicates that the action has an effect on the object. If the arrow points from the object to the action status, it indicates that the action uses the object pointed to by the object stream.
In the activity diagram, the same object can appear multiple times. Each appearance of the object indicates that the object is at different time points of the object's lifetime.
The swimming paths and object streams can be observed in:
A vertical line is a swimming track, and four squares are the objects.
Ii. Activity diagram modeling technology:
① Identify the class or object to describe the workflow. ② Determine the initial and termination statuses of the workflow and define the boundaries of the workflow. ③ Model the action status or activity status. ④ Model the action stream. ⑤ Model the object stream. 6. refine and refine the model.
Iii. instance resolution:
This is an activity diagram of the library administrator:
Explanation: first, go to the library management system. There are two active branches: 1. Get
Book. That is to say, if a student returns a book, determines whether it has expired. If it expires, the fee is charged, and then the borrower's information is updated. If it does not expire, the borrower's information is directly updated and the activity ends. Ii. Lend
Book. That is to say, if a student book is lent, there is a limit to the judgment. If there is no limit, the books will be lent to update the information. If there is a limit, the books will not be lent. The activity ends.