Creating a derived tag definition for a lightweight extension
To create a derived tag definition for a lightweight extension:
1. If you have not done so already, create a profile Package for your lightweight extensions (see Creating a Profile Package for Lightweight Extensions).
2. If you have not done so already, unprotect the PTC Profile package that contains the profile link type you want to extend.
To unprotect a PTC Profile package, open the PTC Profile package's Property Pages, click the Access Permissions tab, clear the Protected check box, and then click the Copy Protected Flag to Child Packages button.
3. In the PTC profile, locate the Tag Definition on which the derived Tag Definition you are creating will be based.
4. Right-click your profile Package, and select New > UML > Profiles > Tag Definitions.
5. Type the name of the Tag Definition, and then press the Enter key.
6. Open the Tag Definition's Property Pages, and then click the Type tab.
7. Set the Data Type to Reference, select the Derived check box, and set the Model Item Types to the Model Item Types that are valid for the Tag Definition on which your Tag Definition is based.
8. Open the Property Pages of the Tag Definition on which your Tag Definition is based and copy the script that appears on the Derivation Script tab.
9. Open your Tag Definition's Property Pages, click the Derivation Script tab, and paste the copied script.
10. Make the following changes to the script:
a. Delete the model object reference (the blue text), and replace it with a model object reference the owning item, that is, your Tag Definition. To do this, drag the Tag Definition to the Script.
b. Replace the role name that follows the '("Name")' text in the script with the role you want to use for your derived Tag Definition.
To determine the role name to use, run the Wrapper Details report against the Stereotype that owns the role: Right-click the Stereotype (or an item based on that Stereotype), and select Tools > Profile Extensions > Wrapper Details.
On the Meta Model Viewer dialog, expand the Roles folder and find the role you want to use (its name will be derived from your profile Package name and the role name), copy the complete name, and use it to replace the role name in the copied script.
11. Click the Items tab, in the Show Associated list select Stereotypes, click the Link button, and select the Stereotypes for which you want to show the Tag Definition.
For example, select the «RequirementRelated» stereotype to show your derived Tag Definition on the RequirementRelated tab in the Property Pages.
12. Click the Usage tab, and then click the Publisher button.