Customizing the metamodel > Keywords for USRPROPS > DEPICT LIKE > Generic Port
  
Generic Port
Presentation
Where reference is made to a Display Mode property, any property can be given that legend and so become a controlling property by the following form of usrprops entry if the property name does not match the required name:
PROPERTY "isBehavior" { display { format string legend "isBehavioral" } }
Presented as a square, like an AND connector.
This graphic is described in the surrounding text.
If the definition defines interfaces and the Show interface indicators symbol property is configured to show the indicators and the Display Mode data is set to present the Realized Interfaces and Required Interfaces properties then they can appear like this:
This graphic is described in the surrounding text.
The complete circle indicates there are realized interfaces, the incomplete circle indicates there are required interfaces. The positions of these indicators do not change, but they point away from the symbol the port is attached to.
The SysML Flow Property indicator is controlled by the Show Flow Indicator symbol property along with the FlowProperty Display Mode property and the isStereotype FlowProperty boolean property which must be set to “T”.
This is based on a format script (_FmtSysMLFlowProperty) so that this can be changed to build an in/out/inout value based on other properties if required. It currently expects a property with an in/out/inout text value.
If presented, you get a horizontal line in the symbol pen if the port is on a vertical host edge, or a vertical line if the port is on a horizontal host edge. Taking the vertical edge as an example, with the port on the left vertical edge of the host, if the property is set to in you get a -> indicator, out gives you <- and inout gives you <->. If you set the property to in and move the port around the host, the arrow will always point towards the host. Likewise for out, the arrow will always point away from the host.
This graphic is described in the surrounding text.
The presentation of the ‘UML Behavior’ Port indicator is controlled by the Show isBehavior indicator symbol property and the isBehavioral Display Mode property.
The behavior indicator is a rounded rectangle connected to the port with a line. This is always just a little wider and a little narrower in height than the minimum size of the port symbol.
This graphic is described in the surrounding text.   This graphic is described in the surrounding text.
Scripted name.
This graphic is described in the surrounding text.
For a new port definition, the properties are set up so that only the name will show, even though the presentation of the scripted name is enabled by default.
The Present scripted name symbol property controls whether the scripted name is shown.
The _FmtSysMLPortName format script defines the name content:
[ ... ] denotes optional content.
Format: [<<stereotype>> ][name][ : [~]type]
stereotype comes from the Stereotype definition property.
name can be suppressed – based on the Suppress Name symbol property.
type comes from the Type definition property.
~ denotes conjugation based on the isConjugated definition property.
Behavior
You cannot move a port from one host symbol to another. It is believed that this will be of use in complex diagrams where users want to reposition the port on the same host. If they want to change host they can delete without purging and redraw it.
Displayable properties are shown if Show displayable properties is selected.
Port Symbols of the same name can be drawn more than one time.
A message appears if you try to draw a port when a potential host is not present.
The symbol is not resizable by default, but it can be made resizable through a keyword.
You can drag and drop a definition that is only defined or represented by a port symbol.
A port can be drawn on any symbol or the programmed set of symbol types.
A port definition can have a reference to the host definition. See the keyword PORT_HOST_REF_PROP "property name".
Port symbols are added to a Host symbol when it is created, provided that a Ports property exists in the host definition and references definitions. This should be set up to mirror the host reference property in the port definition. If either are not wanted then they can be made to be invisible, but they must both be defined in order for the behavior to work.
This support has been extended. The name of the property referencing the ports can be specified and more than one property can be specified. If no value is found in a property named “GenericPort_Host_PortsRef1”, the “Ports” property is used, otherwise the property named in the value is used, with tests made for further properties, ending when no value is found.
To do this specify code as follows in the host’s definition block, replacing "true_property_name" with the intended property name, edit_type with the intended edit type, and "port_definition_type" with the intended port definition type:
PROPERTY "GenericPort_Host_PortsRef1"
{ edit text default "true property name" invisible}
PROPERTY "true property name"
{ EDIT edit_type "port_definition_type"... }
The above code can be combined with MIRRORS to keep the Port’s host reference property and the Host’s port reference property in synchronization.
The refresh for representational consistency performed on drawing the host also adds any lines associated with the ports.
Port symbols are removed when the host symbol is removed.
Port symbols can be specified to attach to the inside or the outside edge of the host symbol as opposed to straddling it in the example above. See POSITION_RESTRICT_EDGE_INSIDE and POSITION_RESTRICT_EDGE_OUTSIDE.
Keywords
POSITION_RESTRICT_RESET_TYPES
Resets the list of host symbol types for a port symbol.
POSITION_RESTRICT_SUPPORT_TYPE "Type Name" [IN "Diagram Type Name"] [, "Type Name2" [IN "Diagram Type Name"]]
[POSITION_RESTRICT_SUPPORT_TYPE "Type Name3" [IN "Diagram Type Name"] [, "Type Name4" [IN "Diagram Type Name"]]]
Records a new host symbol type for a port symbol.
POSITION_RESTRICT_EDGE_INSIDE
Specifies that the port should attach to the inside edge of the host symbol. Cancels the OUTSIDE specification.
POSITION_RESTRICT_EDGE_OUTSIDE
Specifies that the port should attach to the inside edge of the host symbol. Cancels the INSIDE specification.
SIZE_RESTRICT_ALLOW_RESIZE
Registers that a symbol type can be resized (this is intended to be used to allow resizing where resizing has been disallowed through the DISALLOW keyword).
SIZE_RESTRICT_DISALLOW_RESIZE
Registers that a symbol type already allowed to be resized cannot be resized.
PORT_HOST_REF_PROP "property name"
Specified in the symbol type block.
Registers a reference property from the port to the host, to be populated only on drawing the port. A property supporting single or multiple references is allowed.
See also
AND connector
Generic Line
Generic Line No Name
Generic Node
RoadmapV2
Go up to
DEPICT LIKE