Prev Next

Define Creation of Instance

A stereotyped element can be the classifier of instances created from it. You can define how an instance is created from that stereotyped element, by adding special attributes to the defining Stereotype. The attributes modify the text on the 'Paste As' dialog that displays when a stereotyped element is dragged out of the Project Browser onto a diagram.

Attributes

This example from SysML shows the definition of any instances of a SysML Block element that might be created.

When a user drags a SysML Block element from the Project Browser onto a diagram, the system checks the _instanceType attribute value and searches the SysML Profile for an element template with a matching _metatype attribute value, and generates the instance from that - with the above definition you would get a Block element with the «property» stereotype.

Attribute

Meaning

See also

_instanceMode

Changes the second option for the 'Paste as' field on the dialog to either:

  • Instance (<element type>) or
  • Property (Object)

The text is determined by the value ('Instance' or 'Property') of the attribute's 'Initial Value' field.

If the attribute is not applied, the option defaults to 'Instance'.

_instanceOwner

DEPRECATED

Modifies the second option of the 'Paste as' field on the dialog to:

  • as Instance of <element type>

The text is determined by the value of the attribute's 'Initial Value' field, such as 'Block'.

If the attribute is not applied, the option defaults to 'Element'.

_instanceType

Modifies the second option of the 'Paste as' field on the dialog to:

  • as Instance of Element (ProfileName::<<stereotype>>)

The <<stereotype>> value is defined in the 'Initial Value' field of the attribute, and corresponds to the metatype given to the stereotyped element using the '_metatype' attribute.

Define a Stereotype as a Metatype

Learn more