Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

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 Browser window onto a diagram.

Attributes

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

A UML Profile diagram showing how to define an instance type for a Class stereotype, in Sparx Systems Enterprise Architect.

When a user drags a SysML Block element from the Browser window 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 example 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