An Action element describes a basic process or transformation that occurs within a system. It is the basic functional unit within an Activity diagram. Actions can be thought of as children of Activities. Both represent processes, but Activities can contain multiple steps or decomposable processes, each of which can be embodied in an Action. An Action cannot be further broken down or decomposed.
An Action can be further defined with pre-condition and post-condition notes, and certain properties can be graphically depicted on the Action (Enterprise Architect prompts you to define the type of Action you are creating when you first drag the Action icon from the Toolbox). The data values passed out of and into an Action can be represented by Action Pins. For a named Action (that is, other than a basic Action) you can also assign Action Pins to represent specific properties.
For a basic (Atomic) Action, you can define the effect of the Action using the Effect tab of the element Properties dialog, and select to display the effect on the diagram.
Operations from Classes can be displayed on Activity diagrams as Actions. When an operation is shown as an Action, the notation of the Action displays the name of the Class that features the operation. To add an operation to an Activity diagram follow the steps below:
- Open an Activity diagram.
- From the Project Browser open a Class and locate the operation to be added to the Activity diagram.
- Drag the operation on to the diagram.
- When the operation has been added to the Activity diagram the Action displays the name of the Class that features the operation.
If you right-click on the Action in the diagram, you can locate the behavior classifier (CallBehavior Activity) or call operation (CallOperation Activity) in the Project Browser using the Find | Locate Classifier in Project Browser and Find | Locate Operation in Project Browser context menu options.
If it becomes necessary to change the operation that this Action refers to, follow the steps below:
- Right-click on the Action. The context menu displays.
- Select the Advanced | Set Operation menu option. The Set Operation dialog displays.
- If necessary, in the In Namespace field, select the model that contains the required operation.
- Double-click on the required operation. The Action updates to show the new classifier and operation.
OMG UML Specification
The OMG UML specification (UML Superstructure Specification, v2.1.1, p. 241) states:
An action is a named element that is the fundamental unit of executable functionality. The execution of an action represents some transformation or processing in the modeled system, be it a computer system or otherwise.
The OMG UML specification (UML Superstructure Specification, v2.1.1, p. 313) also states:
An action may have sets of incoming and outgoing activity edges that specify control flow and data flow from and to other nodes. An action will not begin execution until all of its input conditions are satisfied. The completion of the execution of an action may enable the execution of a set of successor nodes and actions that take their inputs from the outputs of the action.