Main Content

Import Requirements from ReqIF Files

Many third-party requirements management applications can export and import requirements using the ReqIF™ format. You can import requirements from a ReqIF file as references to a third-party source called referenced requirements, which are represented as slreq.Reference objects, or as requirements in new requirement sets, which are represented as slreq.Requirement objects. For more information about choosing which import mode to use, see Select an Import Mode.

Choosing an Import Mapping

ReqIF represents requirements as SpecObjects and links as SpecRelations between SpecObjects. Each SpecObjectType specifies the associated SpecObject and the SpecRelationTypes classify each SpecRelation. The SpecObjectType and SpecRelationType define attributes to store requirements and link information. The SpecObjects and SpecRelations contain values for these attributes.

This table compares the organization of requirements and links in Simulink® Requirements™ to their counterparts in ReqIF.

ItemRepresentation in Simulink RequirementsRepresentation in ReqIF
Requirement

SpecObject

Requirement type

  • slreq.Requirement.Type (slreq.Requirement property)

  • slreq.Reference.Type (slreq.Reference property)

SpecObjectType

Requirement attributes

  • SpecObjectType defines attributes

  • SpecObject contains attribute values

Link

slreq.Link

SpecRelation

Link type

slreq.Link.Type (slreq.Link property)

SpecRelationType

Link attributes

slreq.Link properties and custom attributes

  • SpecRelationType defines attributes

  • SpecRelation contains attribute values

For more information about ReqIF data organization, see Exchange Document Content in Requirements Interchange Format (ReqIF) Version 1.2 .

When you import requirements and links from a ReqIF file, the import process maps the SpecObjects to slreq.Requirement objects or slreq.Reference objects, depending on the import mode, and SpecRelations to slreq.Link objects. The imported requirement type, properties, and imported link type depend on the import mapping that you choose.

Simulink Requirements provides built-in import mappings for some third-party applications that use ReqIF:

  • IBM® Rational® DOORS®

  • IBM DOORS Next

  • Polarion™

  • PREEvision

  • Jama

When you import requirements from ReqIF files generated by other requirements management applications, you can use a generic attribute mapping.

After you import requirements, you can edit the attribute mappings. See Mapping ReqIF Attributes in Simulink Requirements.

Note

If you experience problems navigating from requirements in Polarion to items in MATLAB® or Simulink due to changes to navigation URLs enforced by Polarion, you may need to apply a configuration change. Open the polarion.properties file found in the <polarion_installation>/polarion/configuration/ folder and modify these lines by replacing localhost with the externally known name for your server:

  • repo=http://localhost:80/repo/

  • base.url=http://localhost:80/

Using the Built-In Mapping During Import

When you import a ReqIF file and use the built-in mapping for the third-party tool that generated the file, Simulink Requirements imports the SpecObjects as requirements with Type set to Functional regardless of the SpecObjectType. If the SpecObjectTypes define additional attributes in the third-party tool, the attributes map to built-in requirements properties, including Custom ID or ID, Summary, Description and revision information. The remaining attributes map to new custom attributes. For more information about requirement custom attributes, see Customize Requirements with Custom Attributes.

After you import the requirements, you can map the SpecObjectTypes to requirement types. You can also edit the additional SpecObjectType attribute mappings to requirement properties and custom attributes. See Mapping ReqIF Attributes in Simulink Requirements.

When you import links using the built-in mapping, Simulink Requirements imports SpecRelation objects as links and maps the SpecRelationTypes to link types in Simulink Requirements. If a SpecRelationType in the ReqIF file is not defined in the import mapping, then SpecRelations with that type import as links with Type set to Related to. For more information about link types, see Link Types.

Using the Generic Mapping During Import

When you import a ReqIF file and use the generic mapping, Simulink Requirements imports the SpecObjects as requirements with Type set to Functional, regardless of the SpecObjectType. Additional SpecObjectType attributes map to the requirement properties CustomID or ID, Description, and Summary and the rest map to new custom attributes. For more information about requirement custom attributes, see Customize Requirements with Custom Attributes.

After you import the requirements, you can map the SpecObjectTypes to requirement types. You can also edit the additional SpecObjectType attribute mappings so they match your desired requirement properties and custom attributes. See Mapping ReqIF Attributes in Simulink Requirements.

When you import links using the generic mapping, SpecRelations import as links with Type set to Related to. For more information about link types, see Link Types.

Importing Requirements

Requirements in ReqIF files belong to specifications.

  1. Open the Requirements Editor. At the MATLAB command line, enter:

    slreq.editor

  2. In the Requirements Editor, click Import.

  3. In the Importing Requirements dialog, set Document type, to ReqIF file (*.reqif or *.reqifz).

  4. Next to Document location, click Browse and select the ReqIF file.

  5. Under Attribute mapping, in the Source tool drop-down, select the desired attribute mapping. See Choosing an Import Mapping.

  6. Under Destination(s), click Browse. Enter the file name, select the location to save the new requirement set, and click Save.

  7. Select whether to allow updates to the imported requirements. If you want to continue to manage your imported requirements in the third-party tool, select Allow updates from external source. If you want to migrate your requirements to Simulink Requirements, clear Allow updates from external source. For more information about import options, see Select an Import Mode.

  8. Click Import to import the requirements.

The imported requirements maintain the requirement hierarchy.

Importing Requirements from a ReqIF File with Multiple Specifications

If you import a ReqIF file that contains multiple source specifications, you can select options in the Source specifications section in the Importing Requirements dialog. You can:

  • Select a single ReqIF source specification to import into a requirement set. In the Importing Requirements dialog, under Source specifications, select Import a single specification and choose a specification from the list.

  • Combine ReqIF source specifications into one requirement set. In the Importing Requirements dialog, under Source specifications, select Combine all specifications into one Requirement Set.

    If you select Allow updates from external source, then each specification is imported into a separate Import node. You can update each Import node independently. Otherwise, each source specification imports as a parent requirement and all requirements in the specification import as its children.

  • Import each ReqIF source specification into a separate requirement set. In the Importing Requirements dialog, under Source specifications, select Import each specification into a separate Requirement Set. Under Destination(s), next to Folder, click Browse and select a destination folder location to save the requirement sets in.

    The resulting requirement set file names are the same as the source specification name. If you have an existing requirement set file with the same name as one of the source specifications in the selected destination, it is overwritten.

Tip

For large ReqIF files, consider importing each source specification into a separate requirement set. This can help reduce file conflicts and help you track differences in individual requirement sets.

When deciding which import method to use for a ReqIF file that contains multiple source specifications, consider if you are importing links and if you plan to export back to ReqIF. For more information, see Importing Links and Considerations for ReqIF Files with Multiple Specifications.

Importing Links

When you import a ReqIF file to a requirement set, you can import links as well. To import links, in the Importing Requirements dialog, under Source links, select Import links to preserve the links from the ReqIF file. After the import, the Simulink Requirements link set files contain links between requirements or external URLs.

ReqIF files represent links as a SpecRelation between two SpecObjects. You can only import links if the ReqIF file contains at least one SpecRelation between SpecObjects.

Importing Links from a ReqIF File with Multiple Source Specifications

When you import links from a ReqIF file with multiple source specifications, how you import the source specifications affects the link import. If you:

  • Import a single specification into a requirement set, Simulink Requirements only imports the SpecRelations between that specification's SpecObjects are imported. This might omit some links from the ReqIF file during import.

  • Combine multiple ReqIF source specifications into one requirement set, the resolved links import into one link set

  • Import each ReqIF source specification into a separate requirement set, the resolved links import into separate link sets

Mapping ReqIF Attributes in Simulink Requirements

ReqIF represents a requirement as a SpecObject with a SpecObjectType that defines requirement attributes. When you import requirements from a ReqIF file, the attributes map to requirement properties or custom attributes according to the import mapping that you choose. See Choosing an Import Mapping.

After you import the requirements, you can edit the SpecObjectType attribute mapping. Select the Import node, which is denoted by , or the top-level requirement, depending on how you imported the requirements. In the Details pane, under Attribute Mapping, you can edit the attribute mappings. You can save the current mapping by clicking Save mapping. You can load a saved mapping by clicking Load mapping. For more information, see Edit the Attribute Mapping for Imported Requirements.

Map SpecObjectTypes to Requirement Types

After you import the requirements, you can map the SpecObjectTypes to requirement types in Simulink Requirements.

  1. In the Requirements Editor, select the Import node, which is denoted by , or the top-level requirement, depending on if you imported the ReqIF requirements as referenced requirements or requirements.

  2. In the Details pane, under Attribute Mapping, click Map Object Types.

  3. The Map Object Types dialog appears. Imported (external) type lists the SpecObjectTypes and Internal (built-in or custom) type lists the available Simulink Requirements requirement types. Map each SpecObjectType by selecting a requirement type from the list. For more information about requirement types, see Requirement Types. You can also select <Add custom subtype> to add a custom subtype. For more information about custom subtypes, see Define Custom Requirement and Link Types.

    To add a custom subtype:

    1. In the Add Subtype for Requirements dialog, set Parent type name to extend to the requirement type that you want the custom requirement subtype to have.

    2. Next to New subtype name, enter the name for your new custom subtype.

    3. Next to Description, enter a description for your new custom subtype.

    4. Click OK to create the custom subtype.

  4. Click OK to map the SpecObjectTypes to requirement types. A dialog lists the number of items updated.

See Also

Related Topics