Import Requirements fromReqIFFiles
许多第三方需求管理应用程序可以使用REQIF™格式导出和导入需求。您可以从reqif文件导入要求作为第三方源的引用,称为referenced requirements, which are represented asslreq.Reference
objects, 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 asSpecObject
objects and links asSpecRelation
objects that relateSpecObject
objects. EachSpecObjectType
object specifies the associatedSpecObject
object and theSpecRelationType
objects classify eachSpecRelation
object. TheSpecObjectType
andSpecRelationType
对象将属性定义为存储要求和链接信息。这SpecObject
andSpecRelation
objects 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 |
|
|
Requirement type |
|
|
Requirement attributes |
|
|
Link |
|
|
Link type |
|
|
Link attributes |
|
|
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 theSpecObject
objects toslreq。要求
对象或slreq.Reference
objects, depending on the import mode, andSpecRelation
objects toslreq.Link
objects. 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
在
folder and modify these lines by replacingLocalhost
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,Requirements Toolbox进口theSpecObject
objects as requirements withTypeset toFunctional
regardless of the associatedSpecObjectType
object. If theSpecObjectType
objects define additional attributes in the third-party tool, the attributes map to built-in requirements properties, includingCustom ID
orID
,概括
,Description
and 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 theSpecObjectType
objects to requirement types. You can also edit theSpecObjectType
object attribute mappings to requirement properties. SeeMapping ReqIF Attributes in Requirements Toolbox。
When you import links using the built-in mapping,Requirements Toolbox进口SpecRelation
objects as links and maps theSpecRelationType
objects to link types inRequirements Toolbox。If aSpecRelationType
in the ReqIF file is not defined in the import mapping, thenSpecRelation
objects 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进口theSpecObject
objects as requirements withTypeset toFunctional
。这SpecObjectType
object attributes map to theCustomID
orID
,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 theSpecObjectType
objects to requirement types. You can also edit theSpecObjectType
object attribute mappings to match your desired requirement properties. SeeMapping ReqIF Attributes in Requirements Toolbox。
When you import links by using the generic mapping, theSpecRelation
objects 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
要导入与要求相关的图像,请使用第三方工具将要求导出为。reqifz
file and then import the file toRequirements Toolbox。
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.
In theRequirements Editor, clickImport。
In the Importing Requirements dialog, setDocument type, to
ReqIF file (*.reqif or *.reqifz)
。旁边Document location, clickBrowseand select the ReqIF file.
UnderAttribute mapping, in theSource tooldrop-down, select the desired attribute mapping. SeeChoosing an Import Mapping。
UnderDestination(s), clickBrowse。Enter the file name, select the location to save the new requirement set, and clickSave。
选择是否允许进口要求更新。如果您想继续在第三方工具中管理进口要求,请选择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。
ClickImportto import the requirements.
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 aSpecRelation
object that relates twoSpecObject
objects. You can only import links if the ReqIF file contains at least oneSpecRelation
object.
从一个导入链接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 the
SpecRelation
objects that linkSpecObject
objects 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 aSpecObjectType
longName
value 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 proxySpecObject
objects and requirements for proxy objects of the supported types. Links between the proxySpecObject
objects that have theSpecObjectType
longName
attribute set toRequirement
cannot be reconstructed.
To reconstruct the links when you import a ReqIF file, in the Importing Requirements dialog:
UnderSource specifications, select either将所有规格合并为一个要求集orImport each specification into a separate Requirement Set。
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 aSpecObject
object with aSpecObjectType
object 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 theSpecObjectType
object 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。
MapSpecObjectTypes
to Requirement Types
After you import the requirements, you can map theSpecObjectType
objects to requirement types inRequirements Toolbox。
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.
In theDetailspane, underAttribute Mapping, click地图对象类型。
这地图对象类型dialog appears.Imported (external) typelists the
SpecObjectType
objects andInternal (built-in or custom) typelists the availableRequirements Toolboxrequirement types. Map eachSpecObjectType
object by selecting a requirement type from the list. For more information about requirement types, seeRequirement Types。You can also select
to 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:
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.
旁边New subtype name, enter the name for your new custom requirement type.
旁边Description,为您的新自定义要求类型输入描述。
ClickOKto create the custom requirement type.
ClickOK映射
SpecObjectType
objects 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.
Create a navigation callback function. Optionally, you can use the Requirements Toolbox template to develop your navigation callback function. To generate the template:
Import your requirements to Requirements Toolbox.
In theRequirements Editor, select a referenced requirement and, in theDetailspane, underProperties, clickShow in document。
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.
Register the navigation callback function by using
slreq.registerNavigationFcn
。Enter the name of the application that generated the ReqIF file, which is specified in theDomainproperty of the Import node. Useslreq.getNavigationFcn
to 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
Requirements Editor|slreq.import
|slreq.registerNavigationFcn
|slreq.getNavigationFcn