KEMBAR78
UML Activity & Statechart Diagrams | PDF | System | Conceptual Model
0% found this document useful (0 votes)
135 views13 pages

UML Activity & Statechart Diagrams

Uploaded by

ashikapramodpm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views13 pages

UML Activity & Statechart Diagrams

Uploaded by

ashikapramodpm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Activity Diagrams

&
State chart Diagrams

Presented By
Aleena
Activity Diagrams
• Activity diagram is another important diagram in UML to describe the dynamic
aspects of the system.

• Activity diagram is basically a flowchart to represent the flow from one activity to
another activity. The activity can be described as an operation of the system.

• The control flow is drawn from one operation to another. This flow can be
sequential, branched, or concurrent. Activity diagrams deal with all type of flow
control by using different elements such as fork, join, etc
Purpose of Activity Diagrams
• The purpose of an activity diagram can be described as −

• Draw the activity flow of a system.

• Describe the sequence from one activity to another.

• Describe the parallel, branched and concurrent flow of the system.


Components of an Activity Diagram
• 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.

• 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.

• Forks
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
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.
Notation of an Activity diagram
§ Initial State: It depicts the initial stage or
beginning of the set of actions.
§ Final State: It is the stage where all the control
flows and object flows end.
§ Decision Box: It makes sure that the control flow
or object flow will follow only one path.
§ Action Box: It represents the set of actions that are
to be performed.
How to Draw an Activity Diagram
• An activity diagram is a flowchart of activities, as it represents the workflow among various activities. They are
identical to the flowcharts, but they themself are not exactly the flowchart. In other words, it can be said that an
activity diagram is an enhancement of the flowchart, which encompasses several unique skills.
• Since it incorporates swimlanes, branching, parallel flows, join nodes, control nodes, and forks, it supports
exception handling. A system must be explored as a whole before drawing an activity diagram to provide a clearer
view of the user. All of the activities are explored after they are properly analyzed for finding out the constraints
applied to the activities. Each and every activity, condition, and association must be recognized.
• After gathering all the essential information, an abstract or a prototype is built, which is then transformed into the
actual diagram.
Following are the rules that are to be followed for drawing an activity diagram:
• A meaningful name should be given to each and every activity.
• Identify all of the constraints.
• Acknowledge the activity associations.
Example of Activity Diagram
• An example of an activity diagram showing the business flow activity of order processing is given
below.
• 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.
State Chart Diagrams
• The name of the diagram itself clarifies the purpose of the diagram and other details. It
describes different states of a component in a system. The states are specific to a
component/object of a system.

• A Statechart diagram describes a state machine. State machine can be defined as a machine
which defines different states of an object and these states are controlled by external or
internal events.
Purpose of State Chart Diagrams
• Statechart diagram is one of the five UML diagrams used to model the dynamic nature of a system. They
define different states of an object during its lifetime and these states are changed by events. Statechart
diagrams are useful to model the reactive systems. Reactive systems can be defined as a system that
responds to external or internal events.
• Statechart diagram describes the flow of control from one state to another state. States are defined as a
condition in which an object exists and it changes when some event is triggered. The most important
purpose of Statechart diagram is to model lifetime of an object from creation to termination.
• Statechart diagrams are also used for forward and reverse engineering of a system. However, the main
purpose is to model the reactive system.
Following are the main purposes of using Statechart diagrams
• To model the dynamic aspect of a system.
• To model the life time of a reactive system.
• To describe different states of an object during its life time.
• Define a state machine to model the states of an object.
How to Draw a Statechart Diagram
• How to Draw a Statechart Diagram?
• Statechart diagram is used to describe the states of different objects in its life cycle. Emphasis is placed on
the state changes upon some internal or external events. These states of objects are important to analyze and
implement them accurately.
• Statechart diagrams are very important for describing the states. States can be identified as the condition of
objects when a particular event occurs.
• Before drawing a Statechart diagram we should clarify the following points −
• Identify the important objects to be analyzed.
• Identify the states.
• Identify the events.
Example of a State ChartDiagram
• Following is an example of a Statechart diagram where the state of
Order object is analyzed
• The first state is an idle state from where the process starts. The
next states are arrived for events like send request, confirm request,
and dispatch order. These events are responsible for the state
changes of order object.
• During the life cycle of an object (here order object) it goes through
the following states and there may be some abnormal exits. This
abnormal exit may occur due to some problem in the system.
When the entire life cycle is complete, it is considered as a complete
transaction as shown in the following figure. The initial and final
state of an object is also shown in the following figure.
ThankYou

You might also like