Adding Actions to activity diagrams

You can add or draw different types of actions. Actions are the building blocks of activities. You can call actions can that invoke other activities that can be decomposed into other actions.

About this task

Actions represent function invocations with a single exit flow when the function completes. The default settings are used when you add an Action and type a name on the diagram. That name becomes the action text, not the name of the action.

Before adding actions, you must set the properties for the diagram.

Procedure

  1. To set the activity diagram properties, highlight the activity diagram and from the main menu, click View > Properties.
  2. Select View All, and open the Action category. Change the showName and ShowAction properties to use these values:
          Activity_diagram::Action::showName = Name
          Activity_diagram :: Action :: ShowAction = Description

    With this second property, you can display informal text on the diagram, while the actual action is described formally using an executable language. Click OK.

  3. To add an action, click on the opened activity diagram on the diagram view, and click from main menuEdit > Add New > Action.

    Action tool

    The following are the five basic action types that you can use:
    • Action represents the atomic level of activity behavior.
    • Send Action graphically shows an event sent to interact with another block.
    • Accept Event Action handles processing of events during the execution of a behavior.
    • Accept Time Event handles processing of events during the execution of a behavior.
    • Call Behavior invokes a behavior

      when it runs. This action has a set of pins that match the type and number of the parameters of the invoked behavior.
    • Call Operation invokes methods through an operation on a target element.
  4. Click the Action tool Action tool on the activity diagram for the action to be added to the diagram. Name each new action carefully to describe its function.
  5. To edit the name, description, properties and tags, right-click on the action, and select Features. The Features window opens.
  6. In the Features window, in the:
    1. General tab: add the activity name, and the description of the activity. To set the stereotype, right-click on the activity and select the stereotype. ActivityFinal button
    2. Properties tab:
  7. To stop all actions, add an Activity Final by clicking Edit > Add New > Activity Final. Place this ActivityFinal buttonActivityFinal button indicator at the local or global termination point in the activity diagram. The final activity signifies the termination of the execution of the activity.

    ActivityFinal button

  8. To set up the model activities, right-click on the model and select Features. The Properties window opens.

    ActivityFinal button

    The referenced activity cannot own a time out event or except event. If not, an error appears in Checks view.

  9. To show animation of the activity diagram, in the Properties window select the Animation > AutoOpenBehavioralDiagrams property value of Always or WhileStepping.

    ActivityFinal button

    If you select one the values, the animated activity diagram opens.

    ActivityFinal button

What to do next

To terminate a sequence of actions within an activity without terminating the activity, use the Flow Final node. See Adding flows for more information.


Feedback