UNIT2 - Activity Diagrams
UNIT2 - Activity Diagrams
It put emphasis on the condition of flow and the order in which it occurs.
The flow can be sequential, branched, or concurrent, and to deal with such
kinds of flows, the activity diagram has come up with a fork, join, etc.
Why use Activity Diagram?
Activity diagrams are used to visually represent the flow of actions in
a system, and are useful for a variety of purposes:
• Modeling workflows
Activity diagrams can be used to model business workflows, including how multiple users interact with a system.
• Modeling use cases
Activity diagrams can be used to illustrate the flow of events in a use case.
• Modeling software
Activity diagrams can be used to model software elements like functions, methods, and operations.
• Defining system logic
Activity diagrams can be used to define the rules and logic of a system.
• Identifying system constraints
Activity diagrams can help users understand the conditions and constraints associated with specific operations.
• Communicating with clients
Activity diagrams can help developers and clients build a shared understanding of how a system works.
Activity Diagram Notations?
• In activity diagrams, the notations are like visual symbols that
help represent different elements and actions in a simple way.
Components of an Activity Diagram
• Activities
• The categorization of behavior into one or more actions is termed as an activity. In other words, it can be said that
an activity is a network of nodes that are connected by edges. The edges depict the flow of execution. It may
contain action nodes, control nodes, or object nodes.
• The control flow of activity is represented by control nodes and object nodes that illustrates the objects used
within an activity. The activities are initiated at the initial node and are terminated at the final node.
Activity
Activity partition /swimlane
• The swimlane is used to cluster all the related activities in one column or one row. It can be either
vertical or horizontal. It used to add modularity to the activity diagram. It is not necessary to
incorporate swimlane in the activity diagram. But it is used to add more transparency to the activity
diagram.
• Here different set of activities are executed based on if the
number is odd or even. These activities are grouped into a
swimlane.
• Forks and join nodes generate the concurrent flow inside the
activity. A fork node consists of one inward edge and several
outward edges. It is the same as that of various decision
parameters. Whenever a data is received at an inward edge, it
gets copied and split crossways various outward edges. It split a
single inward flow into multiple parallel flows.
• Join nodes are the opposite of fork nodes. A Logical AND
operation is performed on all of the inward edges as it
synchronizes the flow of input across one single output
(outward) edge.
• Pins
It is a small rectangle, which is attached to the action rectangle. It
clears out all the messy and complicated thing to manage the
execution flow of activities. It is an object node that precisely
represents one input to or output from the action.
• Sample example of Activity
• Activity Diagram - Learn by Examples
• Here the input parameter is the Requested order, and once the order is
accepted, all of the required information is then filled, payment is also
accepted, and then the order is shipped. It permits order shipment before
an invoice is sent or payment is completed.
Activity Diagram Example - Student Enrollment
This UML activity diagram example describes a process for student
enrollment in a university as follows:
• An applicant wants to enroll in the university.
• The applicant hands a filled out copy of Enrollment Form.
• The registrar inspects the forms.
• The registrar determines that the forms have been filled out properly.
• The registrar informs student to attend in university overview presentation.
• The registrar helps the student to enroll in seminars
• The registrar asks the student to pay for the initial tuition.
What are the differences?