Activity Diagrams

I l @ ve RuBoard

Activity diagrams also may be created at this stage in the life cycle. These diagrams represent the dynamics of the system. They are flow charts that are used to show the workflow of a system; that is, they show the flow of control from activity to activity in the system, what activities can be done in parallel, and any alternate paths through the flow. At this point in the life cycle, activity diagrams may be created to represent the flow across use cases or they may be created to represent the flow within a particular use case. Later in the life cycle, activity diagrams may be created to show the workflow for an operation.

Activity diagrams contain activities, transitions between the activities, decision points, and synchronization bars. In the UML, activities are represented as rectangles with rounded edges, transitions are drawn as directed arrows, decision points are shown as diamonds, and synchronization bars are drawn as thick horizontal or vertical bars as shown in Figure 3-12.

CREATING ACTIVITY DIAGRAMS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Right-click on the Use Case View in the browser to make the shortcut menu visible.

  2. Select the New:Activity Diagram menu choice. This will add an activity diagram called NewDiagram to the browser.

  3. While the new diagram is still selected, enter the name of the diagram.

  4. Double-click on the activity diagram in the browser to open the diagram.

Figure 3-12. UML Notation for Activity Diagram Elements

graphics/03fig12.jpg

A browser view of an activity diagram is shown in Figure 3-13.

Figure 3-13. Activity Diagram in the Browser

graphics/03fig13.jpg

Activities

An activity represents the performance of some behavior in the workflow.

CREATING ACTIVITIES IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the Activity icon from the toolbar.

  2. Click on the activity diagram window to place the activity.

  3. While the activity is still selected, enter the name of the activity.

Activities are shown in Figure 3-14.

Figure 3-14. Activities

graphics/03fig14.jpg

Transitions

Transitions are used to show the passing of the flow of control from activity to activity. They are typically triggered by the completion of the behavior in the originating activity.

CREATING TRANSITIONS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the state transition icon from the toolbar.

  2. Click on the originating activity and drag the transition arrow to the successor activity.

Transitions are shown in Figure 3-15.

Figure 3-15. Transitions

graphics/03fig15.jpg

Decision Points

When modeling the workflow of a system it is often necessary to show where the flow of control branches based on a decision point. The transitions from a decision point contain a guard condition, which is used to determine which path from the decision point is taken. Decisions along with their guard conditions allow you to show alternate paths through a work flow.

CREATING DECISION POINTS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the Decision icon from the toolbar.

  2. Click on the activity diagram window to place the decision.

  3. While the decision is still selected, enter the name of the decision.

  4. Click to select the Transition icon on the toolbar.

  5. Click on the originating activity and drag the transition to the decision icon.

A decision point is shown in Figure 3-16.

CREATING GUARDED TRANSITIONS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the State Transition icon from the toolbar.

  2. Click on the decision and drag the transition to the successor activity. (Note: Rational Rose may place the transition on top of an existing transition. To separate the transition, select the transition and drag it onto the activity diagram window.)

  3. Double-click on the transition arrow to make the Specification visible.

  4. Select the Detail tab.

  5. Enter the guard condition in the Guard Condition field.

  6. Click the OK button to close the Specification.

Figure 3-16. Decision in an Activity Diagram

graphics/03fig16.jpg

A transition with a guard is shown in Figure 3-17.

CREATING RECTILINEAR LINES IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the line that should be rectilinear (multi-select may be accomplished by first selecting the Shift button).

  2. Select the Format: Line Style: Rectilinear menu choice.

  3. Relocate the lines as needed by selecting the line and dragging it to the desired location on the activity diagram window.

Figure 3-17. Guarded Transition

graphics/03fig17.jpg

Rectilinear lines are shown in Figure 3-18.

Figure 3-18. Rectilinear Lines

graphics/03fig18.jpg

Synchronization Bars

In a workflow there are typically some activities that may be done in parallel. A synchronization bar allows you to specify what activities may be done concurrently. Synchronization bars are also used to show joins in the workflow; that is, what activities must complete before processing may continue. That said, a synchronization bar may have many incoming transitions and one outgoing transition, or one incoming transition and many outgoing transitions.

CREATING SYNCHRONIZATION BARS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the Horizontal Synchronization or the Vertical Synchronization icon from the toolbar.

  2. Click on the activity diagram window to place the synchronization bar.

  3. Click to select the State Transition icon on the toolbar and add any needed incoming and outgoing transitions to the synchronization bar.

Synchronization bars are shown in Figure 3-19.

Figure 3-19. Synchronization Bars

graphics/03fig19.jpg

Swimlanes

Swimlanes may be used to partition an activity diagram. This typically is done to show what person or organization is responsible for the activities contained in the swimlane .

CREATING SWIMLANES IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the Swimlane icon from the toolbar.

  2. Click on the activity diagram window to place the swimlane. This will add a swimlane called NewSwimlane to the diagram.

  3. Double-click on the NewSwimlane (the words) to open the Specification.

  4. Enter the name of the swimlane in the Name field.

  5. Click the OK button to close the Specification.

  6. To resize the swimlane, click on the swimlane border and drag the swimlane to the desired location.

  7. Drag all needed activities and transitions into the swimlane. (Note: You may also create new activities and transitions in the swimlane.)

An activity diagram with swimlanes is shown in Figure 3-20.

Figure 3-20. Swimlanes

graphics/03fig20.jpg

Initial and Final Activities

There are special symbols that are used to show the starting and final activities in a workflow. The starting activity is shown using a solid filled circle and the final activities are shown using a bull's eye. Typically, there is one starting activity for the workflow and there may be more than one ending activity (one for each alternate flow in the workflow).

CREATING STARTING AND ENDING ACTIVITIES IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Click to select the Start State or the End State icon from the toolbar.

  2. Click on the activity diagram window to place the start or end state.

  3. If you added a start state, click on the State Transition icon, click on the start state, and drag the transition to the first activity in the workflow.

  4. If you added an end state, click on the State Transition icon, click on the successor activity, and drag the transition to the end state.

An activity diagram with start and end states is shown in Figure 3-21.

Figure 3-21. Start and End States

graphics/03fig21.jpg

I l @ ve RuBoard


Visual Modeling with Rational Rose 2002 and UML
Visual Modeling with Rational Rose 2002 and UML (3rd Edition)
ISBN: 0201729326
EAN: 2147483647
Year: 2002
Pages: 134

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net