Overview of lightweight extensions of PTC profiles
Lightweight extensions allow you to create your own item and link types that are extensions of item and link types that are provided in a supported PTC profile.
A lightweight extension uses Stereotypes to create new item or link types, but in doing so it creates subtypes of items and links in the PTC profile.
Through lightweight extensions you can quickly create the new item and link type, and the required New, Link and Populate commands and tab buttons for that new item or link type.
The Help includes worked examples that demonstrate how to create lightweight extensions.
|
• The lightweight extensions you create should contain only letters, numbers, underscores, and spaces.
• You cannot extend diagrams through lightweight extensions.
|
Benefits of using lightweight extensions
Creating a new item or link type through lightweight extensions provides the following advantages over creating a new item or link types independently through Stereotypes:
• The new item or link type inherits the properties of the extended item.
You can add additional properties to the new item or link type through Tag Definitions.
• The new item or link type appears in the same selection dialogs as the item or link type it extends.
When selecting a type to use through the Select Type, if items of the extended item type are available for selection or creation, then items of the new item type are also available for selection or creation.
• The new item or link type can be linked to the same items as the extended item or link type through the Links Editor or Quick Links dialog.
When linking items in Modeler, if items of the extended item type are available for linking in the Links Editor, then items of the new item type are also listed.
• The new item or link type will appear on the same diagram types as the extended item, and it will have buttons to create the new item or link type based on the tab buttons for creating the extended item or link.
Note that on diagram tabs, the new button will be grouped with the tab buttons that are used to create the extended item or link.
• The new item or link type will have commands for creating, linking or populating the new item or link type based on extended item's commands.
Any dialogs that are opened for the type that is extended are also opened for the new type. For example, if you create a new type based on a SysML Block Property, when you create the new type Modeler will open the Select Type dialog for you to select a type.
• The new item type will behave the same as the extended item when double-clicked.
Supported PTC profiles
For information about which PTC Profiles can be extended (which includes the SysML Profile, UML Profile and MBRE Profile), see the Modeler Release Notes.
Profile package
When you define new items and links through lightweight extensions, you do so by creating Stereotypes and Script items and using inheritance to integrate them with the PTC Profile you are extending.
The items you create for your lightweight extensions need to reside in a Profile Package, that is, a Package that has the Profile check box selected in its Property Pages. In addition, the Profile Package must have the «LightweightProfile» stereotype applied to it.
In the Profile Package you can create a Profile Diagram on which you define the inheritance between PTC Profile Stereotypes and your Profile Package Stereotypes. You can create Packages within your profile Package to organize any items you create; do not select the Profile check box for these Packages.
|
Do not create items within a PTC Profile package as those items will be deleted if you update the PTC profile.
|
Lightweight extensions of items and links
You define a lightweight extension of a PTC Profile item or link type by creating a new Stereotype and setting it up as a sub Stereotype of the Stereotype that defines the PTC Profile item or link you are extending.
Through the Style options of the Stereotype that defines the new item or link type you can select an icon to use in the browsers and for buttons, and choose presentation options to use when it appears as a diagram symbol.
After creating a new item or link type you can create the commands and buttons for it through the Create Scripts command. For more information, see
Creating a link type through a lightweight extension, and
Creating an item type through a lightweight extension.
Making lightweight extensions available after the profile helper has been initialized
After the Profile Helper has been initialized for lightweight extensions in a model, further changes to those lightweight extensions take effect only after the Lightweight Profile Version number is changed to a later version (unless Profile Helper caching is disabled).
You are prompted to change the Lightweight Profile Version number when you use the Build Cache/Extensions command.
While developing lightweight extensions you can see the effects of any changes you make without having to change the Lightweight Profile Version number by disabling Profile Helper caching. For more information, see
Disabling profile helper caching.
Creating derived tag definitions for your new item and link types
After creating new item and link types, you may want to create derived tag definitions to list those items and links in the places that the extended profile items and links are listed. For example:
• If you create a new link type that is based on the Satisfies link, you may want to create a derived tag definition for the «RequirementRelated» stereotype that lists items that are linked through your new link type.
Note that the «RequirementRelated» stereotype's Satisfies tag definition that is provided in the SysML profile will not list items that are linked through an extension of the Satisfies link.
• If you create a new item type that is based on the Flow Port item, you may want to create a derived tag definition for the «Block» stereotype that lists your new items that are child items of Blocks.
Note that the «Block» stereotype's flowPorts tag definition will not list child items that are an extension of the Flow Port item.
For information about creating derived Tag Definitions for item and link extensions, see
Creating a derived tag definition for a lightweight extension.
Distributing lightweight extensions to other models
After creating lightweight extensions in a model, other models can use those extensions by importing the appropriate Profile Packages to those models. For more information, see
Distributing lightweight extensions to other models.
Adding your profile to the new model and add profiles dialogs
After creating a profile Package, you can make that profile available for selection in the New Model and Add Profiles dialogs. For more information, see
Making a profile available in the new model and add profiles dialogs, and
Making the update all profiles command available for a profile.