Contents > 8 Defining Custom Design Metrics and Rules > 8.2 Definition of Sets > 8.2.2 Subelements

8.2.2 Subelements

Similar to the subelements procedure for metrics (see Section 8.1.8 "Subelements"), the subelements procedure for sets allows for a simple way to define a set of all elements that a given model element contains.

For example, to define the set of all actors in a model, we simply write:

<set name="ActorSet" domain="model"> 
  <description>The set of actors defined in the model.</description>
  <subelements target="actor"/>
</set>
The subelements procedure for sets takes the following, optional, attributes: