Main Content

Import Requirements from IBM DOORS by Using the API

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

Configure IBM DOORS

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

rmi setup doors

For more information, see Configure IBM DOORS Session.

Open the DOORS Project

In this example, you will use the DemoRMI.dpa project in IBM DOORS, which contains requirements modules that describe a fault-tolerant control system.

In IBM DOORS, create a new project:

  1. Select File > New > Project.

  2. In the New Project dialog, enter ExampleProject in the Name field.

  3. In the Description field, enter Example MATLAB/Simulink project.

  4. Select Use a project archive.

  5. Click Browse and select DemoRMI.dpa.

newProject.png

Import a Requirements Module

In this example, you will import all of the requirements from the FuelSys Requirements Specification module.

In IBM DOORS, open the FuelSys Requirements Specification module and find the module ID. For more information, see How to identify the unique ID for an item in DOORS database explorer on the IBM website.

Use slreq.import to 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 set fuelSysReqSpec, and enter the module ID. The function returns the number of imported referenced requirements, the requirement set file path, and the requirement set object.

[refCount1,reqSetFilePath1,myReqSet1] = slreq.import("linktype_rmi_doors", ...
    AsReference=true,RichText=true,ReqSet="fuelSysReqSpec",DocID="000001c1");
Importing from 000001c1 of type linktype_rmi_doors ..
.. done.

Import a Subset of Requirements from a Module

You can import a subset of requirements from the FuelSys Design Description module by appling a filter. Open the FuelSys Design Description module in IBM DOORS.

Filter the Requirements Module

Apply a filter to the module. For more information on applying a filter to a requirements module, see Defining filters on the IBM website. In the Filtering dialog:

  1. Set Attribute to Absolute Number.

  2. Set Condition to is less than or equal to.

  3. Next to Value, enter 10.

filter.png

The module displays only requirements that match the filter.

filteredModule.png

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.

Import the Filtered Requirements Module

To import the filtered requirements module, use slreq.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 set fuelSysDesignSpec, but don't enter the module ID. If you don't specify the module ID, the slreq.import function imports the active requirements module.

The module contains a requirements attribute called Created Thru. 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={'Created Thru'});
Importing from FuelSys Requirements Specification of type linktype_rmi_doors ..
.. done.

Requirements Toolbox imports only the first 10 requirements from the module and maps the Created Thru attribute to a new custom attribute in the requirement set.

importedFuelSysDesignSpec.png

If you have custom attributes that you want to import as the built-in requirement properties Rationale or Keywords, you can use:

slreq.import("linktype_rmi_doors",keywords="Keyword DOORS Attribute", ... 
    rationale="Rationale DOORS Attribute")

For more information about custom attributes, see Add Custom Attributes to Requirements.

Update the Filtered Requirement Set

After you import the requirement set, you can update it. For more information, see Update Imported Requirements.

In DOORS, change the applied filter in the FuelSys Design Description module.

In the Filtering dialog:

  1. Set Attribute to Absolute Number.

  2. Set Condition to is less than or equal to.

  3. Next to Value, enter 15.

Find the Import node from the requirement set myReqSet2. Update the requirement set.

importNode = find(myReqSet2,Index="Import1");
status = updateFromDocument(importNode);
Importing from FuelSys Requirements Specification of type linktype_rmi_doors ..
.. done.

Requirements Toolbox amends the requirement set to contain the first 15 requirements.

importedFuelSysDesignSpec2.png

In your DOORS requirements module, update the filter again. For Value, enter 5. Find the Import node from the requirement set myReqSet2. Update the requirement set.

importNode = find(myReqSet2,Index="Import1");
status = updateFromDocument(importNode);
Importing from FuelSys Requirements Specification of type linktype_rmi_doors ..
.. done.

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

importedFuelSysDesignSpec3.png

See Also

|

Related Topics