Extend Architectural Design Using Stereotypes
You can add the
unitPrice property to an electrical component using a
stereotype. A stereotype extends the modeling language with domain-specific metadata. A
stereotype adds properties to the root-level architecture, component architecture, ports,
connectors, data interfaces, and value types. You can also apply a stereotype to only a
specific element type, such as component architectures. When a model element has a stereotype
applied, you can specify property values as part of its architectural definition. In addition
to allowing you to manage properties relevant to the system specification within the
architecture model, stereotypes and associated properties also allow you to analyze an
A profile contains a set of model element stereotypes with custom properties.
Each profile contains a set of stereotypes, and each stereotype contains a set of properties.
This example will show you how to compute the total cost of the system given the cost of its constituent parts. The example profile is limited to this goal.
Start this tutorial with the following mobile robot architecture model without a profile applied. Use the model to follow the steps and populate its elements with stereotypes and properties.
Mobile Robot Architecture Model
This example shows a mobile robot architecture model with no properties defined. You can apply the stereotypes from the profile
Use the Property Inspector to set the properties on each component.
Load Architecture Model Profile
Load a profile to make stereotypes available for model elements. This procedure uses the
ex_RobotArch.slx. Navigate to Modeling > Profiles > Profile Editor to open the Profile Editor. Open the profile file
simpleProfile.xml to load the profile in the Profile Editor.
In the profile, observe these stereotypes.
|components, ports, connectors|
Importing the profile makes stereotypes available to their applicable elements.
sysGeneralis a general stereotype, applicable to all element types, that enables adding generic properties such as a
Note, which project members can use to track any issues with the element.
sysComponentstereotype applies only to components, and includes properties such as
costthat contribute to the total weight and cost specifications of the robot system.
sysConnectorstereotype applies to connectors and includes
weightproperties defined per meter of length (assuming a physical connector, such as a wire). These properties help compute the total weight and cost of the design.
sysPortstereotype applies to ports and does not include any properties.
You can add a stereotype icon to all component-level stereotypes. You can choose from a set of default icons, or you can create your own icons.
Apply Stereotypes to Model Elements
Add custom properties to a model element by applying a stereotype from a loaded profile.
Navigate to Modeling > Profiles > Import .
Navigate to Modeling > Profiles > Apply Stereotypes to open the Apply Stereotypes dialog box.
In Apply Stereotypes, from Apply stereotype(s) to, select
All elements. From Scope, select
In the list of available stereotypes, select
Click Apply and close the window to exit the dialog box.
GPScomponent. Right-click, then click Apply Stereotype. Select the
sysComponentstereotype is used for managing physical properties and cost.
Repeat these steps for the
Navigate to the top of the model. Apply the
sysComponentstereotype to the
Trajectory Planningcomponents and the top-level architecture model. Right-click each component or a space in the top-level, then select Apply Stereotype to ensure
sysConnectorstereotype to all connectors in the
Trajectory Planninglayer, and the top model layer. Press and hold Shift to select multiple connectors. Right-click the selection, click Apply Stereotype, and select the
Set the property values to enable cost analysis. Follow this example for the
Sensorscomponent, select the
Open the Property Inspector by navigating to Modeling > Design > Property Inspector.
sysComponentstereotype to see the properties.
5and press Enter.
GPSDataport connector. Check that
lengthis set to
unitPriceis set to
Complete the model using the values in this table. If a property is not in the table, it has no effect on the analysis, so you can leave it blank. Pin the Property Inspector to the editor to keep the Property Inspector visible during this operation.
Layer Element Property Value Top layer
The model below reflects the final result of this tutorial. Use this finalized model to perform an analysis and create custom views.
Mobile Robot Architecture Model with Properties
This example shows a mobile robot architecture model with stereotypes applied to components and properties defined.