Main Content

Create and Edit Attribute Mappings

The ReqIF™ format represents a requirement as a SpecObject. The SpecObject has a SpecObjectType, which defines attributes to store requirements information. The SpecObjects contains values for these attributes.

After you import requirements from a ReqIF file, you can customize how attributes from ReqIF requirements map to Simulink® Requirements™ requirement properties and custom attributes. For more information, see Customize Requirements with Custom Attributes. You can also save this mapping for reuse.

Edit the Attribute Mapping for Imported Requirements

You can import requirements from ReqIF files in the Requirements Editor. For more information, see Import Requirements from ReqIF Files.

When you import requirements from ReqIF files, you must choose an import mapping to use. The imported requirement type, properties, and imported link type depend on the import mapping that you choose. For more information, see Choosing an Import Mapping.

After you import requirements from a ReqIF file, you can edit the attribute mapping for the imported requirements:

  1. Open the Requirements Editor and import the ReqIF file. For more information, see Import Requirements from ReqIF Files.

  2. Select the Import node or the top-level requirement, depending on if you imported referenced requirements or requirements. For more information, see Select an Import Mode.

    You can see the attribute mappings in the Details pane, under Attribute Mapping.

  3. Edit the mapping by selecting a property or attribute from the drop-down in the Mapped To column.

    Note

    When editing the attribute mapping, you can only map an attribute to a built-in requirement type. You cannot select a custom attribute from the drop-down in the Mapped To column.

You can save the current attribute mapping by clicking Save mapping. The mapping saves as an XML file. You can load a saved mapping by clicking Load mapping.

To change the name or description of the attribute mapping, open the XML file that you created in a text editor and modify the values of the <name> and <description> tags.

To have Simulink Requirements select the import attribute mapping based on the tool that originally created the ReqIF file:

  1. In a text editor, open the attribute mapping and the ReqIF file.

  2. Find the value of the <REQ-IF-TOOL-ID> tag in the ReqIF file.

  3. Change the value of the <name> tag in the attribute mapping file to match the value of the <REQ-IF-TOOL-ID> tag.

Specify Default ReqIF Requirement Type

Some external requirements management tools, such as Polarion™, support multiple types of requirements. In this case, modify the attribute mapping file to specify the default ReqIF requirement type to use when exporting to ReqIF. For example:

<thisType>SpecObject</thisType>
<thisSubType>System Requirement</thisSubType>
The value of the <thisSubType> tag indicates that each exported SpecObject will have the SpecObject type as System Requirement.

Specify ReqIF Template

Some external requirements management tools, such as Polarion and IBM® Rational® DOORS®, require a specific set of ReqIF data type, attribute, and SpecObject type definitions. They may also require that the ReqIF specification be of a certain type. You can supply these definitions by specifying the name of a template ReqIF file in the mapping file produced by the external requirements management tool. During ReqIF export, Simulink Requirements imports the template file and uses it to generate and export a ReqIF file with a format that is compatible with the external tool.

Save the template files in the same folder as the attribute mapping file, matlabroot/toolbox/slrequirements/attribute_maps. To specify a template file in the attribute mapping, open the attribute mapping file that corresponds to the external requirements management tool in a text editor. Modify the value of the <templateFile> tag to match the name of the template file. You might need to restart MATLAB® to be able to select the mapping file in the Importing Requirements dialog.

Related Topics