Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Advanced extensibility through stereotype scripts and script items > Extending model open and close behavior > Setting up model open behavior through a stereotype
  
Setting up model open behavior through a stereotype
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, see .
To set up model open 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.
4. Click the Items tab.
5. In the drop-down list box select Model Item Types, and then click the Link button.
6. In the middle or right pane, select the check box associated with Model, and then click OK.
7. Click the Model Events tab.
8. Select the On Open check box.
9. 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, see the following topics:
Script functions, attributes and objects - model close and open scripts
Script functions, attributes and objects - overview
Script template for model close scripts
10. Apply the Stereotype you created to the model (in the Packages pane, you can drag the Model icon to the Stereotype).
The script is run whenever the model is opened in Modeler.