able to : – Describe the kinds of actions in an activity – Describe control and object flows – Create an activity diagram
Module Code and Module Title Title of Slides ‹#›
Activity Diagram
• Depicting the flow of control and
sequencing among activities. • An activity diagram shows the sequence of activities, decision nodes, loops, and even concurrent activities. • To depict one or more steps in the use case description.
Module Code and Module Title Title of Slides ‹#›
Activity Diagram
• Activity diagrams can describe system
workflow, use case, class, or operation behaviour – Read like a flowchart • Can model control and dataflow – Sequential and synchronous actions
Module Code and Module Title Title of Slides ‹#›
Elements in Activity Diagram
A step in the activity, in which the
Action users or software perform some task.
A connector that shows the flow of
Control Flow control between actions.
Indicates the first action or actions
Initial Node in the activity.
An end to the activity. When a
Activity Final token arrives, the activity Node terminates.
Module Code and Module Title Title of Slides ‹#›
Elements in Activity Diagram
A flow final node terminates a flow.
Unlike the activity final node, which ends an entire activity, Flow Final Node reaching a flow final node has no effect on other parallel flows that are being processed within the activity at the same point in time.
A conditional branch in a flow. Has
one input and two or more outputs. An Decision Node incoming token emerges on just one of the outputs.
Module Code and Module Title Title of Slides ‹#›
Elements in Activity Diagram
Divides a single flow into
concurrent flows. Each incoming Fork Node token produces a token on each outgoing connector. Combines concurrent flows into a single flow. When every incoming Join Node flow has a token waiting, a token is produced on the output. Required to merge flows that were split with a decision node. Has two or more Merge Node inputs and one output. A token on any input emerges on the output.
Module Code and Module Title Title of Slides ‹#›
Example 1: Dematerialize Cargo
Module Code and Module Title Title of Slides
Elements in Activity Diagram
A call behavior action represents a linked
Call Behaviour call to a separate activity (and its Action corresponding activity diagrams)
The individual elements of an activity
diagram can be divided into Activity individual areas or 'partitions'. Partition Various criteria can lead to the creation of these partitions: organization entities, cost centers, locations, etc:
Module Code and Module Title Title of Slides ‹#›
Call operation action: modelling class operations • A call operation action transmits an operation call request • To create, drag an operation onto the diagram to create a call operation action – The action takes the name of the operation
Module Code and Module Title Title of Slides ‹#›
Partition
• Group activity nodes and edges that have
common characteristics – Provide a view of the behaviors in an activity, but do not affect the control flow or object flow – Describe who or what is responsible for the activities that they contain
Module Code and Module Title Title of Slides ‹#›
Module Code and Module Title Title of Slides ‹#› Module Code and Module Title Title of Slides ‹#› Object flow
• Object flow models the data flow within an activity
• Object flow can only be attached to object nodes or pins on actions • Object nodes and object flow provide the capabilities for explicit data flow modeling • An object node represents the data participating in an activity diagram – It represents an instance of a classifier (such as a class), as well as the corresponding data and behaviour Module Code and Module Title Title of Slides ‹#› Object Flow
• The ‘Opening Door’
activity sends an ‘open’ command to the ‘door’ object. • The ‘Waiting for Transmitter’ activity reads the status of the ‘transmitter’ object. • The objects are instances of the ‘Door’ and ‘Transmitter’ classes. Module Code and Module Title Title of Slides ‹#› Object Flow
• An object node is an abstract class, and is
specialized by the following object nodes: • Pins • Activity parameter nodes • Data stores
Module Code and Module Title Title of Slides ‹#›
Object Flow : Pins
• Pins are either input pins or output pins
• Pins model where actions and activities are sending and receiving data
Module Code and Module Title Title of Slides ‹#›
Object Flow: Activity Parameter
• Represent the data parameters coming
into or going out of an activity – Can send and receive – May have an associated data type (such as a class or interface)
Module Code and Module Title Title of Slides ‹#›
Object Flow: Data store
• Used to model persistent data, such as
saving information to a database, or retrieving information from a database
Module Code and Module Title Title of Slides ‹#›
Review
• Draw and explain all the elements in
activity diagram.
Module Code and Module Title Title of Slides ‹#›
Q&A
Module Code and Module Title Title of Slides ‹#›
Hospital Management System
Module Code and Module Title Title of Slides ‹#›
Purchasing Department
• Create an activity diagram based on the following narrative. The
purchasing department handles purchase requests from other departments in the company. People in the company who initiate the original purchase request are the "customers" of the purchasing department. A case worker within the purchasing department receives that request and monitors it until it is ordered and received. Case workers process the requests for purchasing products under $1,500, write a purchase order, and then send it to the approved vendor. Purchase requests over $1,500 must first be sent out for a bid from the vendor that supplies the product. When the bids return, the case worker selects one bid. Then, the case worker writes a purchase order and sends it to the approved vendor.