Operations Dialog - Behavior

This topic illustrates how to elaborate a method's function in a diagram.

The Behavior tab of the Operations dialog enables you to enter free text to describe the functionality of an operation. Use pseudo-code, structured English or just a brief description.

You can also use the Behavior tab to formally describe a method or State action and have the text appear under the method/action name in a diagram.

State Operations - Behavior

A State's do, entry and exit operations optionally refer to other behaviors such as Activities, Interactions or Operations. Use the [ ... ] (browse) button to invoke the Select <Item> dialog, and locate and select the required behavior.

Show Behavior in a Diagram

To show behavior in a diagram, follow the steps below:

  1. Create or locate the required operation.
  2. Click on the Behavior tab of the Operations dialog.
    Behaviour2                                DiagramBehavior
  3. Select the Show Behavior in Diagram checkbox.
  4. Click on the Save button.

Associate With Behavior

A Class operation can be associated with a behavior elsewhere in the model. Display the operation's Properties dialog, select the Behavior tab, click on the [ ... ] (browse) button and select the required behavior from the Select Element dialog. The behavior is set in the Behavior field, and the operation is then set as the specification of the associated behavior. For example:



In behavioral code generation, the behavior of the associated behavioral element is generated as the operation's code. In the following illustration, Op1 is associated with the Activity Activity.




The generated code for Op1 is as follows:

package Package;

public class Container {

       public Container(){



       public void finalize() throws Throwable {



       public void op1(){

       /*Activity element(Activity1)'s behavior rendered as                operation(op1)'s code*/


               if (cond1)










       /*Activity element(Activity1)not rendered*/

       public void Activity2()


               // behavior is a Activity



       public void Interaction()


               // behavior is a Interaction


}//end Container


See Also