主要内容

Import Requirements fromReqIFFiles

许多第三方需求管理应用程序可以使用REQIF™格式导出和导入需求。您可以从reqif文件导入要求作为第三方源的引用,称为referenced requirements, which are represented asslreq.Referenceobjects, or as requirements in new requirement sets, which are represented asslreq。要求objects. For more information about choosing which import mode to use, seeSelect an Import Mode

Choosing an Import Mapping

ReqIF represents requirements asSpecObjectobjects and links asSpecRelationobjects that relateSpecObjectobjects. EachSpecObjectTypeobject specifies the associatedSpecObjectobject and theSpecRelationTypeobjects classify eachSpecRelationobject. TheSpecObjectTypeandSpecRelationType对象将属性定义为存储要求和链接信息。这SpecObjectandSpecRelationobjects contain values for these attributes.

This table shows the relationship between requirements and links inRequirements Toolbox™and their ReqIF counterparts.

Item Representation inRequirements Toolbox Representation in ReqIF
Requirement

SpecObjectobject

Requirement type

longNameattribute of theSpecObjectTypeobject

Requirement attributes

  • SpecObjectTypeobjects define attributes

  • SpecObjectobjects define attribute values

Link

slreq.Linkobject

SpecRelationobject

Link type

Typeproperty ofslreq.Linkobject

longNameattribute of theSpecRelationTypeobject

Link attributes

slreq.Linkpropertiesandcustom attributes

  • SpecRelationTypeobjects define attributes

  • SpecRelationobjects define attribute values

For more information about ReqIF data organization, see the Exchange Document Content section inRequirements Interchange Format (ReqIF) Version 1.2lo

When you import requirements and links from a ReqIF file, you can choose the import mode that you use based on how the import process maps the requirements from ReqIF toRequirements Toolbox。这import process maps theSpecObjectobjects toslreq。要求对象或slreq.Referenceobjects, depending on the import mode, andSpecRelationobjects toslreq.Linkobjects. The imported requirement type, properties, and imported link type depend on the import mapping that you choose.

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

  • IBM®理性的®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. SeeMapping ReqIF Attributes in Requirements Toolbox

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 thepolarion.properties/polarion/configuration/folder and modify these lines by replacingLocalhostwith 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,Requirements Toolbox进口theSpecObjectobjects as requirements withTypeset toFunctionalregardless of the associatedSpecObjectTypeobject. If theSpecObjectTypeobjects define additional attributes in the third-party tool, the attributes map to built-in requirements properties, includingCustom IDorID,概括,Descriptionand revision information. The remaining attributes map to new custom attributes. For more information about requirement custom attributes, seeAdd Custom Attributes to Requirements

After you import the requirements, you can map theSpecObjectTypeobjects to requirement types. You can also edit theSpecObjectTypeobject attribute mappings to requirement properties. SeeMapping ReqIF Attributes in Requirements Toolbox

When you import links using the built-in mapping,Requirements Toolbox进口SpecRelationobjects as links and maps theSpecRelationTypeobjects to link types inRequirements Toolbox。If aSpecRelationTypein the ReqIF file is not defined in the import mapping, thenSpecRelationobjects with that type import as links withTypeset toRelated to。For more information about link types, seeLink Types

Using the Generic Mapping During Import

When you import a ReqIF file and use the generic mapping,Requirements Toolbox进口theSpecObjectobjects as requirements withTypeset toFunctional。这SpecObjectTypeobject attributes map to theCustomIDorID,Description, and概括requirement properties, and to new custom attributes. For more information about requirement custom attributes, seeAdd Custom Attributes to Requirements

After you import the requirements, you can map theSpecObjectTypeobjects to requirement types. You can also edit theSpecObjectTypeobject attribute mappings to match your desired requirement properties. SeeMapping ReqIF Attributes in Requirements Toolbox

When you import links by using the generic mapping, theSpecRelationobjects import as links withTypeset toRelated to。For more information about link types, seeLink Types

Importing Requirements

You can import requirements in theRequirements Editor。Requirements in ReqIF files belong to specifications.

Tip

要导入与要求相关的图像,请使用第三方工具将要求导出为。reqifzfile and then import the file toRequirements Toolbox

  1. Open theRequirements Editorwith one of these approaches:

    • At the MATLAB command line, enter:

      slreq.editor
    • In the MATLABAppstab, underVerification, Validation, and Test, click theRequirements Editorapp.

    • In the SimulinkAppstab, under模型验证,验证和测试, click theRequirements Editorapp.

  2. In theRequirements Editor, clickImport

  3. In the Importing Requirements dialog, setDocument type, toReqIF file (*.reqif or *.reqifz)

  4. 旁边Document location, clickBrowseand select the ReqIF file.

  5. UnderAttribute mapping, in theSource tooldrop-down, select the desired attribute mapping. SeeChoosing an Import Mapping

  6. UnderDestination(s), clickBrowse。Enter the file name, select the location to save the new requirement set, and clickSave

  7. 选择是否允许进口要求更新。如果您想继续在第三方工具中管理进口要求,请选择Allow updates from external source, which imports the requirements as referenced requirements. If you want to migrate your requirements toRequirements Toolbox, clearAllow updates from external source。For more information about import options, seeSelect an Import Mode

  8. ClickImportto import the requirements.

这imported requirements maintain the requirement hierarchy.

Importing Requirements from aReqIFFile with Multiple Specifications

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

  • Select a single ReqIF source specification to import into a requirement set. In the Importing Requirements dialog, underSource specifications, selectImport a single specificationand choose a specification from the list.

  • 结合ReqIF源规范one requirement set. In the Importing Requirements dialog, underSource specifications, selectCombine all specifications into one Requirement Set

    If you selectAllow 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, underSource specifications, selectImport each specification into a separate Requirement Set。UnderDestination(s), next toFolder, clickBrowseand select a destination folder location to save the requirement sets in.

    这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, seeImporting Linksand具有多个规格的REQIF文件的考虑

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, underSource links, select导入链接to preserve the links from the ReqIF file. After the import, theRequirements Toolboxlink set files contain links between requirements and other Model-Based Design items.

ReqIF files represent links as aSpecRelationobject that relates twoSpecObjectobjects. You can only import links if the ReqIF file contains at least oneSpecRelationobject.

从一个导入链接ReqIFFile 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:

  • 一个规范导入需求et,Requirements Toolboxonly imports theSpecRelationobjects that linkSpecObjectobjects within that specification. This import 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.

从一个导入链接ReqIFFile Generated byRequirements Toolbox

If you link a requirement inRequirements Toolboxto an item that is not contained in the requirement set, such as a Simulink block, and then export the requirement and associated links to a ReqIF file, the export process inserts aSpecObject对象的ReqIF文件作为一个代理object for the linked item. If the linked item is one of the supported types, the proxy object has aSpecObjectTypelongNamevalue that describes the linked object type. For more information, seeExporting Links

When you re-import this ReqIF file, the software reconstructs the links that relate the proxySpecObjectobjects and requirements for proxy objects of the supported types. Links between the proxySpecObjectobjects that have theSpecObjectTypelongNameattribute set toRequirementcannot be reconstructed.

To reconstruct the links when you import a ReqIF file, in the Importing Requirements dialog:

  1. UnderSource specifications, select either将所有规格合并为一个要求集orImport each specification into a separate Requirement Set

  2. UnderSource links, selectImport Links

这reconstructed links use theRequirements Toolboxdefault link storage. For more information, see要求链接存储。这reconstructed links are appended to the link set for the artifact that contains the link source. If the link set is not available, it is created with the same base file name as the artifact and stored in the same folder as the artifact.

MappingReqIFAttributes inRequirements Toolbox

ReqIF represents a requirement as aSpecObjectobject with aSpecObjectTypeobject 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. SeeChoosing an Import Mapping

After you import the requirements, you can edit theSpecObjectTypeobject attribute mapping. Select the Import node, which is denoted by, or the top-level requirement, depending on how you imported the requirements. In theDetailspane, underAttribute Mapping, you can edit the attribute mappings. You can save the current mapping by clickingSave mapping。You can load a saved mapping by clickingLoad mapping。For more information, seeEdit the Attribute Mapping for Imported Requirements

MapSpecObjectTypesto Requirement Types

After you import the requirements, you can map theSpecObjectTypeobjects to requirement types inRequirements Toolbox

  1. In theRequirements 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 theDetailspane, underAttribute Mapping, click地图对象类型

  3. 这地图对象类型dialog appears.Imported (external) typelists theSpecObjectTypeobjects andInternal (built-in or custom) typelists the availableRequirements Toolboxrequirement types. Map eachSpecObjectTypeobject by selecting a requirement type from the list. For more information about requirement types, seeRequirement Types。You can also selectto add a custom requirement type that is a subtype of a built-in type. For more information about custom requirement types, seeDefine Custom Requirement and Link Types

    To add a custom requirement type:

    1. In the Add Subtype for Requirements dialog, setParent type name to extendto the built-in requirement type that you want the custom requirement type to inherit from.

    2. 旁边New subtype name, enter the name for your new custom requirement type.

    3. 旁边Description,为您的新自定义要求类型输入描述。

    4. ClickOKto create the custom requirement type.

  4. ClickOK映射SpecObjectTypeobjects to requirement types. A dialog lists the number of items updated.

从引用要求到第三方申请中的要求

To navigate from a referenced requirement to the original requirement in the third-party application, create a navigation callback function and register the function in MATLAB.

  1. Create a navigation callback function. Optionally, you can use the Requirements Toolbox template to develop your navigation callback function. To generate the template:

    1. Import your requirements to Requirements Toolbox.

    2. In theRequirements Editor, select a referenced requirement and, in theDetailspane, underProperties, clickShow in document

    3. In the Requirement Navigation Error dialog box, clickGo to Editor。这generated template opens in the MATLAB Editor and is saved in the current folder. Add your navigation callback function to the template.

  2. Register the navigation callback function by usingslreq.registerNavigationFcn。Enter the name of the application that generated the ReqIF file, which is specified in theDomainproperty of the Import node. Useslreq.getNavigationFcnto confirm that you registered the callback.

To navigate from a referenced requirement in Requirements Toolbox to the original requirement in the third-party application, in theRequirements Editor, select a referenced requirement and, in theDetailspane, underProperties, clickShow in document

See Also

|||

Related Topics