Operations Dialog - General

The Operations dialog has five tabs:

The General tab of the Operations dialog enables you to define new operations and set the most common properties, including name, access type and return.

Note:

The General tab can vary according to the type of element you are adding an operation to. If defining operations for a data modeling table, see the Index, Trigger, Check Constraint topic. The following illustrations are for the operations of an Object element and a State element.

operations-general

stateops

Field/Button

Use to

Name

Display the selected operation name.

Parameters

Display the parameter list. See Parameters Dialog for information regarding what this string can contain.

Edit Parameters

Open the Parameters dialog.

Return Type

(Not shown for State or State Machine elements.)

Display the data type returned by the operation.

The type can be defined by the code language (data type) or by a classifier element. When you click on the drop-down arrow, the set of values in the list provides the appropriate data types.

To select or define possible classifiers, either click on the Select Type option in the list, or click on the [ ... ] (Select) button to display the Select <Item> dialog.

To add new code language data types that can be displayed in this list, see the Data Types topic.

[ ... ] (Return Type Browse button)

Open the Select <Item> dialog to select the operation return type.

(Not shown for State or State Machine elements.)

Action

Define the action of the operation: do, exit or entry.

(For State or State Machine elements.)

Scope

Select Public/Protected/Private/Package.

Stereotype

Specify an optional stereotype for this operation.

Concurrency

Set the concurrency of the operation.

Alias

Define an optional alias for the operation.

Notes

Enter free text notes. You can format this text if necessary, using the Notes toolbar at the top of the field.

Virtual/Abstract

If the operation's language is set to C++, map to the C++ Virtual keyword. Otherwise this option is Abstract, pertaining to an abstract function.

(Not shown for State or State Machine elements.)

Return Array

Indicate that the return value is an array.

(Not shown for State or State Machine elements.)

Synchronized

Specify a code engineering flag that relates to multi threading in Java.

(Not shown for State or State Machine elements.)

Static

Indicate that the operation is a static member.

(Not shown for State or State Machine elements.)

Const

Indicate that the return type of this method is constant.

(Not shown for State or State Machine elements.)

Pure

Indicate that C++ is pure virtual syntax - for example:

virtual void myFunction( ) = 0;

(Not shown for State or State Machine elements.)

IsQuery

Indicate that this method does not modify the object.

(Not shown for State or State Machine elements.)

Operations

List the defined operations.

Up/Down Buttons

Change the order of operations in the list.

New

Create a new operation.

Copy

Copy the currently selected operation.

Save

Save a new operation, or save modified details for existing operation.

Delete

Delete the currently selected operation.

Note:

  • If you make changes and do not save them, the Cancel button prompts you to confirm or cancel the changes, whilst the Close button closes the dialog immediately and does not save the changes.
  • If you are creating many operations, go to the Attribute/Operations page of the Options dialog (Tools | Options | Source Code Engineering | Attribute/Operations) and select the After save, re-select edited item checkbox. Now, when you create an operation and click on the Save button, the dialog fields clear ready for you to enter the details of the next operation. This helps you when you want to create operations quickly and might not necessarily want to fully define each one as you create it.