Use the following tips and techniques when you design a UML 2.0 Activity Diagram. Usually you create Activity Diagrams after State Machine Diagrams.
To design a UML 2.0 Activity Diagram, follow this general procedure:
- Create one or more activities. You can place several activities on a single diagram, or create a separate diagram for each.
Warning: You cannot create nested activities.
- Usually activities are linked to states or transitions on State Machine Diagrams. Switch to your State Machine Diagrams and associate the activities you just created with states and transitions.
Tip: After that you can find that some more activities must be created, or the same activity can be used in several places.
- Switch back to the Activity Diagram. Think about flows in your activities. You can have an object flow (for transferring data), a control flow, both or even several flows in each activity.
- Create starting and finishing points for every flow. Each flow can have the following starting points:
- Initial node
- Activity parameter (for object flow)
- Accept event action
- Accept time event action Each flow finishes with a Activity Final or Flow Final node. If your activity has several starting points, they can be used simultaneously.
- Create object nodes. You do not link object nodes to classes on your Class Diagrams. However, you can use hyperlinks for better understanding of your diagrams.
- Create action nodes for your flows. Flows can share actions.
Warning: You cannot create nested actions.
- For object flows, add pins to actions. Connect actions and pins by flow links.
- Add pre- and postconditions. You can create plain text or OCL conditions.
- You can optionally create shortcuts to related elements of other diagrams.
To add an activity parameter to an activity:
- In the Tool Palette, press the Activity Parameter button.
- Click the target activity. Or: Choose AddActivity Parameter on the activity context menu.
Result: An
Activity Parameter node is added to the activity as a rectangle. Note that the activity parameter node is attached to its activity. You can only move the node along the activity borders.
Note: Activity parameters cannot be connected by control flow links.