Papyrus Banner

Element Type Configurations for UML Profiles

For detailed information about the Element Types framework of GMF/Papyrus, see the Toolsmiths/ElementTypeConfigurationsFramework section.

This section focuses on how Element Type Configuration models can be generated from a Profile, as well as maintained when the Profile evolves.

The Element Type Configurations model for UML Profiles

The Element Type model generated from a UML Profile contains one SpecializationTypeConfiguration per Stereotype Extension, extending the UML Metamodel Type corresponding to the extended UML Metaclass. Each Specialization Type contains a Stereotype Matcher to identify the existing Stereotyped Elements, and an Advice to automatically apply the Stereotype on creation. Further customization (Such as setting some values during the creation of the Stereotyped Element, or attaching custom Advices) must be done manually.

Generating the Model

The Element Type Configuration model can be generated by opening the profile in the Papyrus editor. From the Model Explorer view, right click on the Profile, and select Generate Tooling Model > Element Types...

This opens the Model Generation wizard:

In this wizard, you can select:

The options related to the incremental generation will be discussed in the next section.

When pressing finish, the model will be generated at the selected location, and will contain one Specialization Type Configuration for each Stereotype Extension:

Incremental Generation

Since the generated model only contains the simple structure for your Profile Types (Which may or may not be sufficient), it is often required to add custom Advices to the generated Specialization Types. If the profile evolves (Usually with new Stereotypes), the generator can be used to update an existing Element Types Model to include the Specialization Types related to these new Stereotypes, without affecting the existing Types. This way, the user changes will be preserved.

Incremental Generation is the default behavior when generating the Element Types and selecting a target Folder/Model that already exists:

The following profile changes will be considered by the incremental generator: