Set Properties Using Stereotypes
Stereotypes provide a mechanism to extend the core language elements and add domain-specific metadata. Apply stereotypes to core element types. An element can have multiple stereotypes. Stereotypes allow you to style different elements. Stereotypes provide elements with a common set of properties, such as mass, cost, and power.
In activity diagrams, you can add stereotypes containing custom properties to action nodes, flows, and parameter nodes. You can also assign colors to different stereotypes.
This topic shows how to create and assign stereotypes for activity diagram. The example shows a functional flow diagram for modeling a mobile robot architecture that travels between a randomized starting point and destination.
Open Model
Open the example.
openExample('systemcomposer/OpenActivityDiagramForRobotExample');
Open the project.
openProject("scMobileRobotExample");
For more information on this example, see Author Activity Diagrams.
Load Architecture Model Profile
A profile is a package of stereotypes.. You can use profiles to create a domain of specialized element types.
To load the profile, navigate to Modeling > Profile Editor. Open the profile file
ActivityDiagramProfile.xml
.
In the ActivityDiagramProfile
profile, the stereotype
CriticalProcess
is defined for actions with a property of
SafetyFactor
. The default value of
SafetyFactor
is 1
.
Apply Stereotypes to Element
You can apply stereotypes to elements in your activity diagram using the Property Inspector or the Apply Stereotypes dialog box.
Right-click an element and select Apply Stereotype. In the Apply Stereotype dialog box, from the Stereotype list, select an available stereotype.
In the RobotActivity
example, the Plan Path
,
Follow Path
and Error out
action nodes have
the stereotype of a safety-critical process.
To apply stereotypes using the Property Inspector, select an element in the diagram. In the Property Inspector, select a stereotype from the Stereotype list.
If a profile has multiple stereotypes, you can change the profile by right-clicking the profile and selecting Change Stereotype.
See Also
Functions
Tools
Blocks
- Initial Node | Action Node | Pin | Parameter Node | Decision or Merge Node | Join or Fork Node | Flow Final Node | Activity Final Node