Customization > Automation Interface > Working with Stereotypes and Tag Definitions > Working with stereotypes and tag definitions (automation interface)
  
Working with stereotypes and tag definitions (automation interface)
The following diagram summarizes the associations used when working with Stereotypes and Tag Definitions.
Defining Stereotypes
Specify valid model item types through the Meta Model Type association.
Specify Tag Definitions it applies through the Tag Definition association (Stereotype association from the Tag Definition).
The Package association to a scoped Stereotype is Contained Stereotype.
For more information about a Stereotype's attributes and associations, see Stereotype.
Defining Tag Definitions
Specify the Stereotypes that apply the Tag Definition through the Stereotype association (Tag Definition association from the Stereotype).
If the Tag Definition whose data type is Reference, specify valid model item types through the Meta Model Type and Referenced Stereotype associations.
The Package association to a scoped Tag Definition is Contained Tag Definition.
For more information about a Tag Definition's attributes and associations, see Tag Definition.
Applying Stereotypes to an item
Apply a Stereotype to an item through the Stereotype association (Model Object association from the Stereotype).
The item's type must be valid for any Stereotypes you apply to it. You can determine which Stereotypes are valid through the derived Valid Stereotypes association.
You can determine which Tag Definitions are applied to the item through the derived Tag Definitions association.
Alternatively, you can apply a Stereotype to all valid item types by setting the Stereotype's Apply To All Objects attribute to TRUE. Note that the options that appear on the Directly-Stereotyped Options tab of a Stereotype's Property Pages apply to items only when the Stereotype is applied directly to an item.
Setting a tag value for an item
For Tag Definitions whose Data Type property is set to Boolean, Enumeration and Text, use standard functions to set a tag value for an item. The property name is that of the Tag Definition.
For Tag Definitions whose Data Type property is set to Reference, reference a target item through an association whose name is that of the Tag Definition that is being used to make the reference. From the referenced item, you can navigate to the referencing item through an association named through the Tag Definition's Inverse Name property. If the Tag Definition's Inverse Name property is blank, you can navigate to the referencing item through an association whose name is that of the Tag Definition prefixed by 'INVERSEOF'.
For Tag Definitions whose Data Type property is set to Rich Text, see Overview of copying text and graphics to rich text for more information.