主要内容

Import Requirements from IBM Rational DOORS by using the API

This example shows you how to import requirements from an IBM® Rational® DOORS® module by using the Requirements Toolbox™ API.

Configure IBM Rational DOORS

To interface with IBM Rational DOORS, configure MATLAB®. At the MATLAB command prompt, enter:

RMIsetup

有关更多信息,请参阅Configure IBM Rational DOORS Session

打开门项目

在此示例中,您将使用demormi.dpaproject in IBM Rational DOORS, which contains requirements modules that describe a fault-tolerant control system.

在IBM Rational Doors中,创建一个新项目:

  1. Select文件>新的>Project

  2. 在新的项目对话框中,输入exampleProject在里面Namefield.

  3. 在里面描述字段,输入Example MATLAB/Simulink project

  4. Select使用项目档案

  5. Click浏览and selectdemormi.dpa

Import a Requirements Module

在此示例中,您将从Fuelsys要求规格module.

In IBM Rational DOORS, open theFuelsys要求规格module and find the module ID. For more information, see如何在门数据库资源管理器中识别项目的唯一IDon the IBM website.

利用slreq.importto import the module. Enter the name of the requirement set file, specify that the requirements are referenced requirements and should use Rich Text Formatting, name the requirement setfuelSysReqSpec,并输入模块ID。该函数返回导入的参考要求的数量,要求集文件路径和要求集对象。

[refCount1,reqSetFilePath1,myReqSet1] = slreq.import(“ linkType_rmi_doors”,。。。asreference = true,richText = true,reqset ="fuelSysReqSpec",DocID="000001c1")
从类型的linkType_rmi_doors ....完成的000001C1导入。
refcount1 = 59
reqSetFilePath1 = 'C:\Users\jdoe\MATLAB\Examples\ImportRequirementsFromIBMRationalDOORSByUsingTheAPIExample\fuelSysReqSpec.slreqx'
myReqSet1 =带有属性的重新确定:描述:''名称:'fuelsysreqspec'文件名:'c:\ users \ jdoe \ jdoe \ matlab \ xpless \ importrements fromibmrationaldoorsydoorsytheapie theapiex theapiexipe theapiexpample \ fuelsysreqspamplecreateon:nat modifyby:'ahoward'modifyon:08-sep-2021 09:18:37

Import a Subset of Requirements from a Module

您可以导入一个subset of requirements from theFuelSys Design Description通过添加过滤器来模块。打开FuelSys Design DescriptionIBM理性门中的模块。

过滤需求模块

Apply a filter to the module. For more information on applying a filter to a requirements module, see定义过滤器on the IBM website. In the Filtering dialog:

  1. SetAttributeto绝对数字

  2. SetConditiontois less than or equal to

  3. 旁边价值, enter10

该模块仅显示匹配过滤器的要求。

When you apply a filter to your DOORS module and import the module to Requirements Toolbox, the process imports only the requirements that match the filter. When you import requirements by using the API, Requirements Toolbox does not store the filter for future use.

导入过滤需求模块

To import the filtered requirements module, useslreq.import。Enter the name of the requirement set file, specify that the requirements are referenced requirements and should use Rich Text Formatting, name the requirement setfuelSysDesignSpec, but don't enter the module ID. If you don't specify the module ID, theslreq.importfunction imports the active requirements module.

该模块包含一个要求的要求属性通过创建。Import the attribute along with the requirements as a custom attribute. The function returns the number of imported referenced requirements, the requirement set file path, and the requirement set object.

[refcount2,reqsetfilepath2,myreqset2] = slreq.import(“ linkType_rmi_doors”,reqset ="fuelSysDesignSpec",attributes={“创建”})
Importing from FuelSys Design Description of type linktype_rmi_doors .. done.
refcount2 = 10
reqsetFilePath2 ='c:\ users \ jdoe \ matlab \示例\ infortrequirements fromibmrationaldoorsyoorsbyusingtheapiexample \ fuelsysdesignsignspec.slreqx'
myReqSet2 = ReqSet with properties: Description: '' Name: 'fuelSysDesignSpec' Filename: 'C:\Users\jdoe\MATLAB\Examples\ImportRequirementsFromIBMRationalDOORSByUsingTheAPIExample\fuelSysDesignSpec.slreqx' Revision: 1 Dirty: 1 CustomAttributeNames: {'Created Thru'} CreatedBy:'ahoward'createon:nat修改:'ahoward'修改:08-sep-2021 09:20:30

Requirements Toolbox imports only the first 10 requirements from the module and maps the通过创建attribute to a new custom attribute in the requirement set.

如果您有要导入的自定义属性作为内置要求属性Rationale或者Keywords, 您可以使用:

slreq.import(“ linkType_rmi_doors”,keywords="Keyword DOORS Attribute",理由="Rationale DOORS Attribute")

For more information about custom attributes, see将自定义属性添加到要求

Update the Filtered Requirement Set

导入需求集后,您可以更新它。有关更多信息,请参阅更新导入的要求

In DOORS, change the applied filter in theFuelSys Design Descriptionmodule.

在里面Filtering dialog:

  1. SetAttributeto绝对数字

  2. SetConditiontois less than or equal to

  3. 旁边价值, enter15

从需求集找到导入节点myreqset2。更新需求集。

importNode = find(myReqSet2,Index=“导入1”); status = updateFromDocument(importNode)
Importing from FuelSys Design Description of type linktype_rmi_doors .. done.
status = 'Update completed. Refer to Comments on Import1.'

需求工具箱修改了要求设置以包含前15条要求的要求。

In your DOORS requirements module, update the filter again. For价值, enter5。从需求集找到导入节点myreqset2。更新需求集。

importNode = find(myReqSet2,Index=“导入1”); status = updateFromDocument(importNode)
Importing from FuelSys Design Description of type linktype_rmi_doors .. done.
status = 'Update completed. Refer to Comments on Import1.'

Requirements Toolbox truncates the requirement set to only contain the first 5 requirements.

Cleanup

Clear the open requirement sets.

slreq.clear;

See Also

|

相关话题