Top Banner
UML Activity Diagrams
16
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Uml Activity Diagram

UML Activity Diagrams

Page 2: Uml Activity Diagram

Activity Diagram

• Activity is a particular operation of the system.

• An Activity diagram is a dynamic diagram that shows the activity and the event that causes the object to be in the particular state.

• The diagrams describe the state of activities by showing the sequence of activities performed.

• Activity diagrams can show activities that are conditional or parallel.

Page 3: Uml Activity Diagram

Activity Diagram

• The purposes of 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.

Page 4: Uml Activity Diagram

Elements in Activity Diagram

Initial Activity: This shows the starting point or first activity of the flow. Denoted by a solid circle. This is similar to the notation used for Initial State.

Activity: Represented by a rectangle with rounded (almost oval) edges.

Decisions: Similar to flowcharts, a logic where a decision is to be made is depicted by a diamond, with the options written on either sides of the arrows emerging from the diamond, within box brackets.

Page 5: Uml Activity Diagram

Elements in Activity Diagram

Concurrent Activities: Some activities occur simultaneously or in parallel. Such activities are called concurrent activities. For example, listening to the lecturer and looking at the blackboard is a parallel activity. This is represented by a horizontal split (thick dark line) and the two concurrent activities next to each other, and the horizontal line again to show the end of the parallel activity.

Page 6: Uml Activity Diagram

Elements in Activity Diagram• Fork and Join Nodes

Forks and joins have the same notation: either a horizontal or vertical bar (the orientation is dependent on whether the control flow is running left to right or top to bottom). They indicate the start and end of concurrent threads of control. The following diagram shows an example of their use.

Page 7: Uml Activity Diagram

Elements in Activity Diagram• Decision and Merge Nodes

Decision nodes and merge nodes have the same notation: a diamond shape. They can both be named. The control flows coming away from a decision node will have guard conditions which will allow control to flow if the guard condition is met. The following diagram shows use of a decision node and a merge node.

Page 8: Uml Activity Diagram

Join node vs Merge node

• A join is different from a merge in that the join synchronizes two inflows and produces a single outflow. The outflow from a join cannot execute until all inflows have been received. A merge passes any control flows straight through it.

Page 9: Uml Activity Diagram
Page 10: Uml Activity Diagram
Page 11: Uml Activity Diagram

• The following diagram is drawn with the four main activities:

• Send order by the customer• Receipt of the order• Confirm order• Dispatch order• After receiving the order request condition checks are

performed to check if it is normal or special order. After the type of order is identified dispatch activity is performed and that is marked as the termination of the process.

Page 12: Uml Activity Diagram
Page 13: Uml Activity Diagram
Page 14: Uml Activity Diagram
Page 15: Uml Activity Diagram

Activity Diagram vs. Other Diagrams

• Other diagrams are used to show the message flow from one object to another but activity diagram is used to show message flow from one activity to another.

• Activity diagrams are mainly used as a flow chart consists of activities performed by the system. But activity diagram are not exactly a flow chart as they have some additional capabilities. These additional capabilities include branching, parallel flow etc.

Page 16: Uml Activity Diagram

Sequence diagram vs. Activity DiagramSequence diagrams describe interactions among objects in terms of an exchange of messages over time. Sequence diagrams show a detailed flow for a specific use case or even just part of a specific use case.

Activity diagrams illustrate the dynamic nature of a system by modeling the flow of control from activity to activity. An activity represents an operation on some class in the system that results in a change in the state of the system.