Nested Ports in SysML
This statement is derived from the SysML 1.5 Specification:
'Ports nest other Ports in the same way that Blocks nest other Blocks. The type of the Port is a Block (or one of its specializations) that also has Ports.'
For example, a complex number is made up of two members (of type Real) - the real value and the imaginary value. This is represented by the ComplexNumber Block with two Ports, Real and Imaginary. The Equation Block has a Port that takes a ComplexNumber, but we might want to connect the real and imaginary portions of that variable to different sources. Therefore we have to show them, on the Equation Port, in order to connect them.
This facility is available in Enterprise Architect for all versions of SysML and for UML.
Create Nested Ports in SysML
In describing this procedure, we use a representation of the earlier example as a framework for the steps.
- Create a SysML Block named 'Equation' with a Port also named 'Equation'.
- Create a SysML Block named 'ComplexNumber' with Ports named 'Real' and 'Imaginary'.
- Display the Properties window (press ) for the 'Equation' Port and select the 'Property' page.
- In the 'Type' field, click on the drop-down arrow and select the 'Select Type' option, then locate and select the 'ComplexNumber' Block element; this sets the 'Type' field to 'ComplexNumber'.
- Right-click on the 'Equation' Port and select the 'Features | Interaction Points' option. The Features window displays at the 'Interaction Points' tab.
- Select the 'Show Owned/Inherited' checkbox. The 'Real' and 'Imaginary' Ports are shown in the list panel.
- Select the checkboxes against 'Real' and 'Imaginary'. The two Ports are now nested in the 'Equation' Port.