Papyrus Banner

Using Profiles and Stereotypes

Contents

  1. Using Profiles and Stereotypes
    1. Applying a Profile
    2. Applying a Stereotype
    3. Setting values to stereotype' properties
    4. Display options of a stereotype application

Once a profile has been designed and defined as previously explained, it now times to use it. The first step to process is to apply the profile on your model or a part of the model. This is the purpose of the next section to explain this first step. Then, we will explain how to use the applied profile and mainly how to use its extensions, i.e. its stereotypes.

Applying a Profile

To apply a profile, first you need to open your model.

The first step consists in selecting the part of the model you want to apply the profile on. Profiles can be applied either on Models or Packages. Then to apply the profile on this part, let’s select the profile tab in the property view, and press the Apply Profile button.

Select Package

Profile Tab

Apply Profile

Then, Papyrus will ask you firstly to choose the profile to apply from your workspace, and secondly to choose which part of the selected profile you want to apply. It is indeed possible that your profile may be composed of sub-profiles as explained in the previous chapter. It is then possible to apply partially a profile by applying one or more of its sub-profiles.

Select Profile

Select Profiles

Your model should now look like this:

Applied Profiles

Applying a Stereotype

Once the profile is applied on your model, its extensions, i.e. stereotypes, are available in the modeling tool and can be used in your model to annotate uml elements.

To annotate a model element, you first need to select it either through the model explorer or in one open diagram. Then, select the tab named “profile” in the properties view, and add your stereotype using the Apply Profile button of the widget named “Applied stereotypes”

Apply Stereotype

Apply Stereotype

Apply Stereotype

A dialog box enables you to select the stereotype(s) you want to apply (left part of the dialog box) and using the Add button located in the middle of the dialog box enables to define which stereotypes have to be applied. The list located on the right of the dialog box denotes the list of applied stereotype. If you want to unapply stereotypes, you can select those latter from the right list and use the Remove button to unapply them.

Apply Stereotype

Apply Stereotype

At this point, your Papyrus should look like this:

Applied Stereotype

Setting values to stereotype' properties

As already mentioned, Stereotypes may have properties. Consequently, when applying a stereotype to a model element, it may be necessary to set the values of those properties. For that, you will go to the profile tab of the properties view and then you can unfold the stereotype application as shown in following figure:

Stereotype Properties

Once you have selected the property to edit, its value (if already set, as for example if there is a default value defined in the profile for the property) appear in the right part of the property view. If the property has not yet been valued, you can add a value by using the Add button located on the top right of the widget named “Properties values”. If there is a value, double-click on the value to edit this latter.

Edit Property

Ps: If you want to delete a value set to property, let’s use the Delete button located on the top right of the widget named “Properties values”.

Display options of a stereotype application

Stereotype applications may be graphically rendered under different forms, either textually, or using specific icons. Details to specify those icons associated to a stereotype are given in previous chapters (See definingProfilesAndStereotypes#Stereotype display options).

Let’s remind that in UML, you can apply several stereotypes on a same model element. In Papyrus, it is then possible to select the ones you want to show for each diagram. For showing or hiding a stereotype application, you have to select the tab “appearance” in the properties view. As shown in the next figure, there is one widget named “Applied stereotypes” that denotes the list of stereotypes applied on the current selected model element. On the example illustrated within this figure, you can see on the upper corner of the icon placed in front of the stereotype name “Requirement” an overlay denoting that this stereotype application is shown.

Stereotype Display

Warning: Let’s notice that the appearance tab of the property view is only visible if you select a model element from one of the open diagram. In other case, if you select the model element from the model explorer, the concept of graphical does not make sense because the information specified within this view are only related to graphical information.

Consequently, the values set to the appearance properties of model element are valid only in the context of the diagram where the element is selected. It is then possible to show a stereotype on a diagram and hide it in another diagram depending on the concerns of the view realized by the diagram.

To hide or show stereotype applications, you have to select them from the list of applied stereotypes available within the appearance tab and then either press the Display qualified name button or Display.

The former is to be used if you want to display the stereotype application with its qualified name, and the latter is to be used if you want to show it without qualified name. Using one of both depends if you may have ambiguities or not on the origin of the stereotype when as for example applying several profiles defining similar stereotypes. As for example, both profiles, MARTE and SysML, define a stereotype named «FlowPort».

In addition, there are three other widgets dedicated to configure the stereotype display options:

PS: if you display several stereotype applications, and if you select the options to display them with icon or with icon and text, this is the icon of the first stereotype application in the list which is chosen to be displayed.