On this page

Description

A port is a property of a classifier that specifies a distinct interaction point between that classifier and its environment, or between the (behavior of the) classifier and its internal parts. Ports are connected to the properties of the classifier by connectors through which requests can be made to invoke the behavioral features of the classifier.

A Port can specify the services a classifier provides (offers) to its environment as well as the services that a classifier expects (requires) from its environment. It has the ability to specify that any requests arriving at this port are handled.

The Class model element and Component model elements can have any number of Ports.

You can specify port properties in the port Specification window. In the same window, you can find the description of each property. Descriptions are presented in the description area of the Specification window.


Creating Port

To create a port, do one of the following


  1. From the diagram palette, select port and on the diagram pane, click the element.
  2. Select an element and from the smart manipulator toolbar, choose the Port button.
  3. In the element Specification window, Port property group, click the Create button.

If you have an element displayed as image, you can connect a port to that element with no gaps.

Defining Port type

To define a Port type, do one of the following


  • On a diagram, select a port and press Ctrl+T (press Cmd+T for MAC OS X). Select a type from the list.
  • On a diagram, select a port and in the smart manipulator toolbar, click the Specify Type button. Select a type from the list.
  • In the port Specification windowType property specification cell, select a type.

Displaying Port type

To show the Port type, do one of the following


  • Select a port, and from the shortcut menu, choose Show Type.
  • In the port Symbol Properties dialog, set the Show Type property to true.

Displaying Ports on shapes

To display Ports on shapes


  1. Right-click the shape, select Display > Display Parts/Ports. The Display Parts/Ports dialog opens.
  2. Select ports you want to display on the shape:
    - On the left side of the dialog, select ports manually.
    - On the right side of the dialog, use the panel to select all or particular types of properties or ports.

  3. Click OK when you are done.


  • The port type near the port symbol is displayed if port has referenced type, but has no name.
  • The port type near the port symbol is not displayed if type is provided or required interface and the interface is displayed on the diagram.
  • When a part symbol is created, all its ports are displayed on the diagram.

Creating a Port on a composite structure diagram frame

To create a Port on a composite structure diagram frame


  1. Select an element and from the smart manipulator toolbar, choose the Connector button.
  2. Click the composite structure diagram frame. The port is created and the Select Port list is displayed.
  3. Select one of the following:
    • A hidden port or a nested port of the composite structure diagram.
    • New Port - click to create a port on a diagram frame, with the same name, type and multiplicity, as it is set on the source part or port.
    • Nested Port - click to create a new nested port.

      The Nested Port is available only when creating a connector from the nested port to the diagram frame.

  • You can also quickly create a port on the composite structure diagram frame when drawing a connector straight from a composite structure diagram frame.
  • If a connector is created from a port with the defined type, then only compatible hidden ports are listed in the Select Port list.
  • If a connector is created from a port that has interfaces, then ports that have compatible interfaces are listed in the Select Port list.

Example of Port creation on Composite Structure diagram frame



Example of drawing Connector to Composite Structure diagram frame

Displaying Port in compartment

To display Ports in the element compartment


  1. On the diagram, select a symbol and click the Compartments button.
  2. In the list, select Ports. The ports' compartment is displayed on a symbol.

In the Compartment Edit dialog, you can select which ports to display in the ports' compartment.

Changing position of Port label

To change position of Port label


  1. Right-click the Port shape and select the Symbol Properties command.
  2. In the Symbol Properties dialog, select the All property display mode.
  3. Find the Position of Labels property and select on of the following value:
     - Outside to show the label outside the Port shape.

     - Inside to show labels inside the Port shape.

     - Name and Type Labels Inside to show only the name and type inside the Port shape.

     - Inside Enclosing Shape to show the label outside the Port shape but inside enclosing shape on which boundary the port is created.

    Nested ports do not support Inside Enclosing Shape value.



      

Specifying the Provided/Required Interfaces for a Port

To specify the Provided/Required Interfaces for a Port even if the Port type is not specified


  1. In the Port Specification windowProvided/Required Interfaces property group, click the Add button.
  2. Select to either provided or required interface.
  3. In the case, when the port type is not specified, the Select Port Type dialog is displayed. Select one of the following options:
    • Set provided interface as a port type (available only when creating a provided interface). The provided interface will be specified as the port type.
    • Create "dummy" port type automatically. Create a “dummy” port type and relations between the type and interface.
    • Select or create a port type manually. The Select Port Type dialog will open, to allow you to select or create a Port.
  4. In the element Selection dialog, select or create an interface and click OK.
  • Draw a realize relationship from a port to an interface to create a provided interface. 
  • Draw a usage relationship from a port to an interface to create a required interface.

Converting a Port to an Association

To convert a Port to an Association, do one of the following


  • From the port's shortcut menu, select Refactor > Convert To > Association.
  • In the port's compartment, select a port and drag it out of the shape.

You can convert a port to an association, only if the port type is specified and a port is not a member of any association end.

Displaying a Port name in a signature on a shape

To display a Port name in a signature on a shape


If you cannot find the Show Port property in the Symbol Properties dialog, change the properties display mode to Expert or All.


You can display the Port name on the following shapes:
• Call Operation Action, Call Behavior Action, Send Signal Action, Send Object Action, Broadcast Signal Action, and Start Object Behavior Action.
For example: via <Port name>.


• Transition, Protocol Transition, State, and Accept Event Action.
For example: « from» <Port name>.

Hiding the multiplicity

To hide the multiplicity next to the Port's type


  1. Right-click the Port shape and select Symbol Properties.
  2. In the Symbol Properties dialog, set the Show Multiplicity property value to false.
  3. Click Close.