<@doc hierarchy="GMLDOM" also="@Link"> The Plug object represents the source or target point of a link. (c) SAP AG 2003-2006. All rights reserved. Class Plug inherit Element; implement dev:IInfoset; attach svg:Pin; <@doc>Gets the port object referenced by this Plug. always access this property through @gml:Plug!getTarget function, or through @gml:GmlObject!getProperty!('port'); To access the port's full ID without loading its unit, call ~getTargetFullId() readonly property port = ^Port; <@doc type="@DIRECTIONS">Specify plug's direction virtual readonly property dir = 0; <@doc> Gets the plug's name The plug's name method getName() if (this.name) return this.name; if (this.port) { var trg=this.getTarget(); if (trg) return trg.name; } return ''; end <@doc> Gets the target Port referenced by this Plug. The target port or null otherwise method getTarget() return this.getProperty('port'); end <@doc> Gets the full id of target Port referenced by this Plug. The full id of the target port or null otherwise method getTargetFullId() if (typeof this.port == 'string') return this.port; return $ENV.model.getFullId(this.port); //return $ENV.model.getFullId(this.getTarget()); end <@doc> Gets the object related to this plug -either its parget port, or if no target port - then its parent. The object related to this port method getRelatedObject() var obj = null; obj = this.getTarget(); if(!obj) obj = this.parent; return obj; end <@doc> Queries whether the current plug can be multiple connected . Return ~true iff the plug can multiple connected method canMultipleConnect() return false; end <@enum name="DIRECTIONS"> An enumeration of the available direction types DIR_IN | IN direction DIR_OUT | OUT direction DIR_IO | IN and OUT direction ///////////////////////////////////// // IINFOSET METHODS - prototype implementation <@doc> Gets the infoset's id The infoset's id override method getInfosetId() return this.id; end <@doc> Gets the infoset's friendly name The infoset's friendly name (alias) override method getInfosetAlias() // In plugs the name should represent the usage (==parent) name and the plug name for UI purposes: return this.parent.name + '.' + this.name; end <@doc> Gets the infoshape related to the object depicted by the Plug The infoshape object override method getInfoshape() var obj = this.getRelatedObject(); return (obj && obj.getInfoshape) ? obj.getInfoshape() : null; end