Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Extending drop behavior through stereotypes and scripts > Changing drop behavior through a stereotype
  
Changing drop behavior through a stereotype
Typically, you will want to create Stereotypes within a profile Package.
This topic documents creating a Stereotype through the Packages pane. For information about using a Profile Diagram to create a Stereotype, specify valid model item types and define Scripts, click here
To change drop 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 theEnter 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 diagram types for the Stereotype (the Stereotype can be applied only to item or 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 or diagram types.
d. In the middle or right pane, clear the check boxes associated with invalid item or diagram types.
e. Click OK.
4. Click the UI Events tab.
5. Select the On Drop 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.
Write the script within the ValidDrop and OnDrop functions. For more information about working with scripts:
Script functions, attributes and objects - on drop scripts for diagrams
Script functions, attributes and objects - on drop scripts for items
Script functions, attributes and objects - overview
Script template for on drop scripts for diagrams
Script template for on drop scripts for items
For items, the script will be run whenever an item is copied or moved to an item (in a pane) that is stereotyped directly by the Stereotype.
For diagrams, the script will be run whenever the following drag-and-drop operation are performed on a diagram (in the diagram editor) that is stereotyped directly by the Stereotype:
An item is dragged to the diagram from a pane.
A symbol is moved on the diagram, including the reconnection of a link.