.netCoders Contact Us
Search:

Activity Diagrams

Activity diagrams are used to document workflows in a system, from the business level down to the operational level. When looking at an Activity diagram, you'll notice elements from State diagrams. In fact, the Activity diagram is a variation of the state diagram where the "states" represent operations, and the transitions represent the activities that happen when the operation is complete. The general purpose of Activity diagrams is to focus on flows driven by internal processing vs. external events.

Notation

Activity States Activity states mark an action by an object. The notation for these states are rounded rectangles, the same notation as found in Statechart diagrams.

Transition When an Activity State is completed, processing moves to another Activity State. Transitions are used to mark this movement. Transitions are modeled using arrows.

Swimlane Swimlanes divide activities according to objects by arranging objects in column format and placing activities by that object within that column. Objects are listed at the top of the column, and vertical bars separate the columns to form the swimlanes.

Initial State The Initial State marks the entry point and the initial Activity State. The notation for the Initial State is the same as in Statechart diagrams, a solid circle. There can only be one Initial State on a diagram.

Final State Final States mark the end of the modeled workflow. There can be multiple Final States on a diagram, and these states are modeled using a solid circle surrounded by another circle.

Synchronization Bar Activities often can be done in parallel. To split processing ("fork"), or to resume processing when multiple activites have been completed ("join"), Synchronization Bars are used. These are modeled as solid rectangles, with multiple transitions going in and/or out.

Example

Consider the following example diagram from the UML 1.4 Specification. The Activity Diagram begins with a call to Request Service, the Initial State. Upon completion of this operation, a synchronization bar is used to indicate parallel processing, where the customer pays, and the sales and stockroom staff take and fill the customer's order simultaneously. Another synchronization bar is used to indicate that when the customer has paid and the order has been filled, then the order is ready for delivery. After the delivery of the order, the customer can collect the order, and the process is complete. This is marked with the Final State icon.