Contents > 8 Defining Custom Design Metrics and Rules > 8.7 Defining Metrics for Profiles > 8.7.3 XMI Serialization of Profile Extensions

8.7.3 XMI Serialization of Profile Extensions

To facilitate the tracing of system requirements, the SysML defines requirement diagrams to represent the textual requirements of a system. Formally, a SysML requirement is a stereotype that extends meta-class "class", and defines two new properties "Id" and "Text" to capture a human-readable ID and summary text of the requirement.

The following extract of an XMI file shows a SysML model with a package named "Specifications". The package contains a requirement "XYZ" with Id "R1" and text "The system shall do XYZ":

<xmi:XMI xmi:version="2.1" ...>
  <uml:Model name = "Sample" xmi:id = "xmi1">
    <packagedElement xmi:type="uml:Package" xmi:id="xmi2" name="Specifications">
      <packagedElement xmi:type="uml:Class" xmi:id="xmi3" name="XYZ" />
    </packagedElement>
    ...
  </uml:Model>
  <sysml:Requirement base_Class="xmi3" xmi:id="xmi7" 
    Text="The system shall do XYZ" Id="R1" />
</xmi:XMI>
As a consequence of the UML's lightweight extension approach, two XML elements are needed to represent the requirement: SDMetrics offers three options to deal with such XMI files: