Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Operation Behavior
This topic illustrates how to elaborate a method's function in a diagram. The Behavior page 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 page to formally describe a method or State action and have the text appear under the method/action name in a diagram.
Access Project Browser Operation context menu | Operation Properties | Behavior
Topics
Images |
Topic |
Detail |
See also |
||||
---|---|---|---|---|---|---|---|
|
State Operations - Behaviour |
A State's do, entry and exit operations optionally refer to other behaviors such as Activities, Interactions or Operations. Click on the Element button to display the Select Behavior dialog, and locate and select the required behavior. |
|||||
|
Associate with Behaviour |
A Class operation can be associated with a behavior elsewhere in the model; to do this:
The operation is then set as the specification of the associated behavior. In behavioral code generation, the behavior of the associated behavioral element is generated as the operation's code; in the illustration on the left, Op1 is associated with the Activity Activity. |
|
||||
|
Example Code |
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 //Action1; if (cond1) { //Action2; } else { //Action3; } //Action4; } /*Activity element(Activity1) public void Activity2() { // behavior is a Activity }
public void Interaction() { // behavior is a Interaction } }//end Container
|
|
Learn more