You can define a behavior to be executed correspondingly to the listed events while being in the State whenever the State is entered and exited.

To assign a behavior to a State by dragging


  1. In the Model Browser, select a behavior type element (Activity, Function Behavior, Interaction, Opaque Behavior, State Machine, or Protocol State Machine) or a Signal element.

  2. Drag it to the selected State on the diagram. The list of activities appears.
  • Click a required activity.
    The behavior is assigned to the selected State's activity.

    - If you drag a behavior type element (Activity, Function Behavior, Interaction, Opaque Behavior, State Machine, or Protocol State Machine), the Activity diagram under the Activity element with a Call Behavior Action element are created automatically.

    - If you drag a Signal element, the Activity diagram under the Activity element with a Send Signal Action element are created automatically.

 

To assign a behavior to a State by using the transition's Specification window


  1. Open the State's Specification window.
  2. In the Entry, Do Activity, or Exit category, click the Behavior Type property value cell. The list of available behavior types opens. Select the behavior type from the list.

     If you do not see the Behavior Type property, click the + button near the Entry, Do Activity, or Exit category to expand its content.
  3. According to the selected behavior type, the Behavior Element value is defined automatically. Additional properties Name and Owned Diagram appears. Specify these properties if it is needed.

  4. Click the Close button after you have defined desired properties.

    DoActivity group before assigning behavior type (on the left) and after assigning behavior type (on the right)


If a behavior of an Activity, Interaction, Protocol State Machine, or State Machine type is assigned to an Entry, Exit, or Do activity, a diagram for that behavior is created automatically.