Main Content

addStereotype

Add stereotype to profile

Description

stereotype = addStereotype(profile,stereotypeName) adds a new stereotype with a specified stereotypeName to a profile.

example

stereotype = addStereotype(___,Name,Value) specifies the properties of the stereotype.

Examples

collapse all

Add a component stereotype to the profile.

profile = systemcomposer.profile.Profile.createProfile('LatencyProfile');
stereotype = addStereotype(profile,'electricalComponent','AppliesTo','Component')
stereotype = 

  Stereotype with properties:

                    Name: 'electricalComponent'
             Description: ''
                  Parent: [0×0 systemcomposer.profile.Stereotype]
               AppliesTo: 'Component'
                Abstract: 0
                    Icon: 'default'
    ComponentHeaderColor: [210 210 210 255]
      ConnectorLineColor: [168 168 168 255]
      ConnectorLineStyle: 'Default'
      FullyQualifiedName: 'LatencyProfile.electricalComponent'
                 Profile: [1×1 systemcomposer.profile.Profile]
         OwnedProperties: [0×0 systemcomposer.profile.Property]
              Properties: [0×0 systemcomposer.profile.Property]

Input Arguments

collapse all

Profile object, specified as a systemcomposer.profile.Profile object.

Name of new stereotype, specified as a character vector. The name of the stereotype must be unique within the profile.

Data Types: char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: addStereotype(profile,'electricalComponent','AppliesTo','Component')

See systemcomposer.profile.Stereotype for stereotype properties and values.

Output Arguments

collapse all

Created stereotype, returned as a systemcomposer.profile.Stereotype object.

More About

collapse all

Definitions

TermDefinitionApplicationMore Information
stereotypeA stereotype is a custom extension of the modeling language. Stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata.Apply stereotypes to the root level architecture, component architecture, connectors, ports, and interfaces of a model. Stereotypes provide model elements within the architecture a common set of property fields, such as mass, cost, and power.Define Profiles and Stereotypes
profileA profile is a package of stereotypes to create a self-consistent domain of model element types.Apply profiles to a model through the Profile Editor. You can store stereotypes for a project in one profile or in several. Profiles are stored in .xml files when they are saved.Use Stereotypes and Profiles
propertyA property is a field in a stereotype. For each model element the stereotype is applied to, specific property values are specified.Use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. Properties can also be descriptive or represent a status.Set Properties

Introduced in R2019a