This action might not be possible to undo. Are you sure you want to continue?
Elements of an Activity Diagram Guidelines for Creating Activity Diagrams
number of activities support a business process across several departments Activity diagrams model the behavior in a business process › Sophisticated data flow diagrams › Addresses Parallel concurrent activities and complex processes
Essentially a flow chart – showing flow of control from activity to activity Models the dynamic aspects of systems Focus is the work performed in implementation of an operation or the activities in a use-case instance Variant of a state diagram with a slightly different purpose › To capture actions (work and activities performed) › And the results of the actions (in terms of object-state changes) 4 .
t.: › Who is responsible for the activities.r. or › Where the activities reside in an organization 5 . The states in the activity diagram – called action-states transition directly to the next stage when the action in the state is performed Unlike the normal state diagrams – the events are not specified Another difference is that their actions may be placed in swimlanes A swimlane groups activities w.
An activity diagram is an alternative way of describing interactions which expresses › How actions are taken › What they do (change object states) › When they take place (action sequences) › Where they take place (swimlanes) Has a start point and an end point 6 .
The most common usage of activity diagrams › To capture the internal work of an object 7 . Activity diagrams may be used for different purposes › To capture the work (actions) that will be performed when an operation is executing – the instance of an operation implementation.
organization and objects 8 .› To show how a set of related actions may be performed. and how they will affect objects around them › To show how an instance of a usecase may be performed in terms of actions and object state changes › To show how a business works in terms of workers (actors). workflows.
An activity is an ongoing nonatomic execution. Contents: Distinguishes activity diagrams from all other kinds of diagrams › Action states and activity states › Transitions › Objects 9 .
increment etc 10 . Action States: Are atomic Cannot be decomposed – the action state is not interrupted by any event Considered to take insignificant execution time Eg. initialize. submit plan.
prepare purchase order etc An action state is a special case of an activity state An action state is an activity state that cannot be further decomposed Zoom into the details of an activity state. you will find another activity diagram 11 .Can be further decomposed Nonatomic – may be interrupted Take some time to complete Can be thought of as a composite – made up of other activity states and action states Eg. process bill.
flow of control passes immediately to the next action or activity state This flow is specified by using transitions.When the action or activity of a state completes. or › Until a stop state is encountered 12 . which show the path from one action or activity state to the next action or activity state A simple directed line represents this Semantically these are called triggerless/completion transitions The flow of control continues indefinitely › In case of an infinite activity.
branches can be included This specifies alternate paths taken based on some Boolean expression Branches are represented as a diamond A branch may have one incoming transition and two or more outgoing ones Guard conditions are placed on each outgoing transition 13 .As in a flow chart.
When modeling workflows of business processes we might encounter concurrent flows We use a synchronization bar to specify forking and joining of these parallel flows of control Represented as a thick horizontal/vertical line Fork and join should balance – number of flows leaving a fork should match the number of flows that enter its corresponding join 14 .
each group specifies a locus of activities Each swim-lane has a unique name. When modeling workflows of business processes. every activity belongs to exactly one swim-lane Transitions may cross lanes 15 . and represents a real-world entity Each swim-lane may be implemented by one or more classes In an activity diagram partitioned into swim-lanes. it is useful to partition the activity states into groups Each group represents a component of the business organization responsible for a set of activities Each group is called a swim-lane Separated from its neighbour by a vertical line.
Objects may be involved in the flow of control associated with an activity diagram Objects can be shown explicitly in an activity diagram using a dependency notation. connected to the relevant activity or transition that creates. or modifies these objects This use of dependency relationships and objects is called an object flow because it represents the participation of an object in a flow of control 16 . destroys.
state and attribute values change State of an object can be shown by naming it in square brackets below the object’s name Attributes values are shown in attributes’ compartment below object’s name 17 .In addition to participation. we can also show how an object’s role.
used in two ways To model a workflow: › Focus on activities as viewed by actors that interact and collaborate with the system › Workflows are used to visualize. specify. construct. modeling object flow is of particular importance 21 . and document business processes involving the system we are developing › Here.Common Uses: Activity diagrams model the dynamic aspects of a system Typically.
fork. involves the parameters of the operation and local objects 22 . here. activity diagrams are used as flowcharts › Models the details of a computation › Modeling of branch. and join states is very important › The context of the activity diagram. To model an operation: › Here.
Customer Sales Accounting Warehouse 23 .
These may be real things from the vocabulary of the system. May not be possible to show all the workflows in one diagram Select the business objects that have highlevel responsibilities for the overall workflow. or may be abstract entities Create a swimlane for each important business object 24 .Establish a focus for the workflow.
specify the activities and actions that take place over time and show them in the activity diagram as either activity states or action states 25 .Identify the preconditions of the workflow’s initial state and the postconditions of the workflow’s final state. This helps to model the boundaries of the workflow Starting at the workflow’s initial state.
Show their changing values and states (as necessary) to communicate the intent of the object flow 26 . combine these into activity states. Start with sequential flows in the workflow first. or set of actions. Only then consider forking and joining If there are important objects that are involved in the workflow. show them.For complex actions. and provide a separate activity diagram for each Show the transitions that connect these activity and action states. Then consider branching.
specifying. the primary advantage is its semantic richness. components. and documenting that element’s behaviour. The most common element to model is an operation. Any other operation/signal from another object can be represented along with type checking.An activity diagram can be attached to any modeling element for visualizing. We can attach activity diagrams to classes. and collaborations. it is simply a flowchart of an operation’s actions. constructing. 27 . But. Here. interfaces. nodes. use cases.
Also identify the invariants of the enclosing class that must hold during the execution of the operation Starting at the operation’s initial state. including the parameters and the return types. specify the activities and actions that take place over time and show them in the activity diagram as either activity states or action states. 28 . Identify the preconditions at the operation’s initial state and the post conditions at the operation’s final state.To model an operation: Collect the abstractions involved in this operation.
use forking and joining to show parallel flows of execution Ex: An activity diagram for Computing Fibonacci numbers 29 .Use branching (as applicable) to specify conditional paths and iteration If the operation is owned by an active class.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.