Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Extending delete behavior through stereotypes and scripts > Changing delete behavior through a stereotype
  
Changing delete behavior through a stereotype
Typically, you will want to create Stereotypes within a profile Package.
To change delete behavior through a Stereotype:
1. Right-click the profile Package, point to New, point to UML, point to Profiles, and then click
Stereotype
2. Type a name for the Stereotype, and then press the Enter key
If you want the display name of the Stereotype in Modeler to be different from its real name: on the General tab of the Stereotype's property pages, type the display name in the Name Alias box.
3. Open the Stereotype's Property Pages, and select valid item and diagram types for the Stereotype (the Stereotype can be applied only to items and diagrams whose type is valid):
a. Click the Items tab.
b. In the drop-down list box select Model Item Types, and then click the Link button.
c. In the middle or right pane, select the check boxes associated with valid item and diagram types.
d. In the middle or right pane, clear the check boxes associated with invalid item and diagram types.
e. Click
OK
4. Click the Object Events tab.
5. Select the On Delete check box.
6. In the associated box, type the script.
If you want to change the text in a larger window with the Text Format Toolbar available, click the Editor button.
For more information about working with scripts, click here
The script will be run whenever an item or diagram that is stereotyped directly by the Stereotype is going to be deleted.