Creating ports in capsule-based structure diagrams

In capsule-based structure diagrams, you can create a port to define an interaction point between a capsule and the environment. A port specifies the events that a capsule acts on. You can add a port inside or on the border of a structure diagram.

About this task

A port that is on the border and has public visibility is visible externally, which means that it is part of a capsule's public interface. A port that is inside a structure diagram is not visible outside the capsule because it is not part of the capsule's public interface.

To create a port:

Procedure

  1. In the Project Explorer view, right-click a capsule; then click Open Structure Diagram.
  2. In the Palette, click Port.
  3. In the diagram editor, click where you want to create a port.
  4. Select one of the following options:
    • To bind a port to a new protocol, click Create protocol , type a name for the port, and click OK.
    • To bind a port to an existing protocol, click Select existing element. In the Select Element dialog box, select a protocol and click OK.

Results

Tip: To quickly add a port from the Project Explorer view or diagram editor, right-click a capsule; then click Add UML > Port. You can also create a port by dragging a protocol class from the Project Explorer view to the border or interior of a structure diagram. The type of the port that you create depends on the protocol component that you drag.

Feedback