slreq.import

Import requirements from external documents

Description

slreq.import(docPath) imports requirements content as referenced requirements from an external document located at docPath. The imported requirements are saved in a new requirements set with the same name as the external document. Use this import method to import requirements content from Microsoft® Office documents and from files in the Requirements Interchange Format (.reqif and .reqifz).

[refCount, reqSetFilePath, reqSetObj] = slreq.import(docPath) imports requirements content as referenced requirements from an external document located at docPath and returns the number of references imported refCount. The imported requirements are saved in the requirements set reqSetObj located at reqSetFilePath with the same name as the external document.

slreq.import(docType) imports requirements content as referenced requirements from an external document that is of a registered document type docType. The imported requirements are saved in a new requirements set with the same name as the external document.

slreq.import(docPath,Name,Value) imports requirements content as referenced requirements from an external document located at docPath with options specified by one or more Name, Value pair arguments.

slreq.import(reqifFile) imports requirement content from the ReqIF file reqifFile using a pre-configured attribute mapping.

slreq.import(reqifFile, 'mappingFile', mapFilePath) imports requirement content from the ReqIF file reqifFile using the attribute mapping specified by mapFilePath.

slreq.import('clearcache') cleans up temporary HTML files that are created when importing rich text requirements.

Examples

Import Referenced Requirements

% Import referenced requirements from Microsoft Office documents
slreq.import('Specification002.docx');
slreq.import('D:/Projects/Requirements/Safety321.xlsx');

% Import referenced requirements from an IBM Rational DOORS Module
slreq.import('linktype_rmi_doors');

Input Arguments

collapse all

The file path of the external requirements document, specified as a character vector.

The document type of the external requirements document, specified as a character vector.

Example: 'linktype_rmi_doors'

The file path of the ReqIF file, specified as a character vector.

The file path of the attribute mapping file, specified as a character vector.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'ReqSet','design_specs.slreqx'

Option to import requirements as references, specified as a Boolean value. The value false is supported only for import from Microsoft Office documents.

The name for the existing requirements set that you import requirements into, specified as a character vector.

Example: 'ReqSet', 'My_Requirements_Set'

Option to import requirements as rich text, specified as a Boolean value.

Example: 'RichText', true

Option to import requirements content using user-defined bookmarks. This value is true by default for Microsoft Word documents and false by default for Microsoft Excel® spreadsheets.

Example: 'bookmarks', false

Regular expression pattern for ID search in Microsoft Office documents.

Example: 'match', '^REQ\d+'

Attribute names to import, specified as a cell array.

Note

When importing requirements from a Microsoft Excel spreadsheet, the length of this cell array must match the number of columns specified for import using the 'columns' argument.

Example: 'attributes', {'Test Status', 'Test Procedure'}

Range of columns to import from Microsoft Excel spreadsheet, specified as a double array.

Example: 'columns', [1 6]

Range of rows to import from Microsoft Excel spreadsheet, specified as a double array.

Example: 'rows', [3 35]

Column in the Microsoft Excel spreadsheet that you want to correspond to the ID field in your requirement set, specified as a double.

Example: 'idColumn', 1

Column in the Microsoft Excel spreadsheet that you want to correspond to the Summary field in your requirement set, specified as a double.

Example: 'summaryColumn', 4

Column in the Microsoft Excel spreadsheet that you want to correspond to the Keywords field in your requirement set, specified as a double.

Example: 'keywordsColumn', 3

Column in the Microsoft Excel spreadsheet that you want to correspond to the Description field in your requirement set, specified as a double.

Example: 'descriptionColumn', 2

Column in the Microsoft Excel spreadsheet that you want to correspond to the Rationale field in your requirement set, specified as a double.

Example: 'rationaleColumn', 5

Column in the Microsoft Excel spreadsheet that you want to correspond to the Custom Attributes field in your requirement set, specified as a double.

Example: 'attributeColumn', 6

Import from Microsoft Excel spreadsheets specified in the USDM (Universal Specification Describing Manner) standard format. Specify values as a character vector with the ID prefix optionally followed by a separator character.

Example: 'RQ -' will match entries with IDs similar to RQ01, RQ01-2, RQ01-2-1 etc.

Output Arguments

collapse all

Number of referenced requirements imported, returned as a double.

The file path of the requirement set to which you import requirements to, returned as a character vector.

Handle to the requirement set to which you import requirements to, returned as an slreq.ReqSet object.

Introduced in R2018a