In UML diagrams, you can add parameters to pass information
into and out of operations.
You must have a diagram open in the diagram editor,
and the operations list compartment must be visible. Ensure that you
have not set preferences to filter or hide operations. To see the
parameters that you add to an operation in a classifier, you must
modify the classifier’s properties to show operation signatures.
To add a parameter to an operation:
- In the diagram editor, click an operation to select
it and click the selection to edit it.
- In the parentheses, type the parameter’s direction kind
(if applicable), name, type expression, and default value in the
following syntax:
operation ([direction] name : type-expression = default-value)
For example: getBalance([in] day : Date = 01/01/2005)
- Optional: To add a return type, type the
information after the parentheses. For example: getBalance(day :
Date = 01/01/2005) : MoneyType
Tip: You can also add parameters to operations
in the Model Explorer view.