importFromDocument
Class: slreq.ReqSet
Namespace: slreq
Import editable requirements from external documents
Description
importFromDocument(
imports editable requirements from the external document at
rs
,pathToFile
)pathToFile
to the requirement set specified by
rs
.
importFromDocument(___,
specifies options using one or more name-value arguments in addition to the input
arguments in previous syntaxes.Name=Value
)
Input Arguments
Requirement set file, specified as a slreq.ReqSet
object.
Path to the requirements document file that you want to import editable requirements from, specified as a string scalar or character vector.
Example: "C:\MATLAB\System_Requirements.docx"
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: slreq.import(docPath,AsReference=true)
imports the
requirements in the document located at docPath
as reference
requirements.
General Options
Option to import requirements as referenced requirements, specified as
a true
or false
.
To continue to manage the requirements in a third-party tool, import
the requirements as referenced requirements by setting the value to
true
or using the default value. To migrate the
requirements to Requirements Toolbox™, import the requirements as slreq.Requirement
objects by setting the value to
false
. For more information, see Select an Import Mode.
Example: AsReference=true
Attribute names for custom attribute columns, specified as a cell array of character vectors.
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
attributeColumn
argument.
Example: attributes={'Test Status','Test
Procedure'}
External requirements document identifier, specified as a string scalar or character vector.
Tip
When importing from IBM DOORS®, use the DocID
argument to specify
the module ID.
Example: DocID="0000abcd"
Custom pre-import callback script name to use during import, specified as a string scalar or character vector.
The script that you assign to this callback executes before you import or update requirements. For more information, see Use Callbacks to Customize Requirement Import Behavior.
Example: preImportFcn="myPreImportScript"
Custom post-import callback script name to use during import, specified as a string scalar or character vector.
The script that you assign to this callback executes after you import or update requirements. For more information, see Use Callbacks to Customize Requirement Import Behavior.
Example: postImportFcn="myPostImportScript"
Name of the requirement set to import requirements into, specified as a string scalar or character vector.
If the requirement set exists, the requirements import under a new Import node. If the requirement set does not exist, Requirements Toolbox creates it.
Example: ReqSet="My_Requirements_Set"
Option to import requirements as rich text, specified as
true
or false
. To import rich
text requirements, set RichText
to
true
.
Example: RichText=true
Options for Microsoft Excel and Microsoft Word
Option to import requirements content using user-defined bookmarks,
specified as numeric or logical
1
(true
) or
0
(false
).
By default, Requirements Toolbox sets the value to 1
for Microsoft Word documents and 0
for Microsoft
Excel spreadsheets.
Example: bookmarks=false
Regular expression pattern for ID search in Microsoft Office documents, specified as a string scalar or character vector.
Example: match="^REQ\d+"
Options for Microsoft Excel
Range of columns in the Microsoft
Excel spreadsheet to map as custom attributes of the
requirements in your requirement set, specified as a
double
array.
Example: attributeColumn=[4 6]
Range of columns to import from Microsoft
Excel spreadsheet, specified as a double
array.
Example: columns=[1 6]
Column in the Microsoft
Excel spreadsheet to map to the CreatedBy
property of the requirements in your requirement set, specified as a
double
.
Example: createdByColumn=5
Column in the Microsoft
Excel spreadsheet to map to the Description
property of the requirements in your requirement set, specified as a
double
.
Example: descriptionColumn=2
Column in the Microsoft
Excel spreadsheet to map to the ID
property
of the requirements in your requirement set, specified as a
double
.
Example: idColumn=1
Column in the Microsoft
Excel spreadsheet that you want to map to the
Keywords
property of the requirements in your
requirement set, specified as a double
.
Example: keywordsColumn=3
Column in the Microsoft
Excel spreadsheet to map to the ModifiedBy
property of the requirements in your requirement set, specified as a
double
.
Example: modifiedByColumn=6
Column in the Microsoft
Excel spreadsheet to map to the Rationale
property of the requirements in your requirement set, specified as a
double
.
Example: rationaleColumn=5
Range of rows to import from Microsoft
Excel spreadsheet, specified as a double
array.
Example: rows=[3 35]
Name of worksheet to import from Microsoft Excel workbook, specified as a string scalar character vector.
Example: sheet="Sheet1"
Column in the Microsoft
Excel spreadsheet to map to the Summary
property of the requirements in your requirement set, specified as a
double
.
Example: summaryColumn=4
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: USDM="RQ -"
will match entries with IDs
similar to RQ01
, RQ01-2
,
RQ01-2-1
etc.
Options for ReqIF Files
ReqIF attribute mapping, specified as a containers.Map
object.
Example: attr2reqprop=attrMap
Option to import links when importing requirements from ReqIF files, specified as true
or
false
.
Example: importLinks=true
Path of attribute mapping file, specified as a string scalar or character vector.
Example: mappingFile="D:/reqifmapping/myMapping.xml"
Name of profile to use when importing requirements and links from ReqIF files, specified as a string scalar or character vector.
If a profile with this name does not exist, the software creates it and assigns it to the imported requirement set and link set. If a profile with this name exists, the software assigns it to the imported requirement set and link set.
Example: profile="myProfile"
Name of the profile mapping file to use when importing requirements and links from ReqIF files, specified as a string scalar or character vector.
The profile mapping XML file specifies how ReqIF requirement and link types and attributes map to
Requirements Toolbox stereotypes and stereotype properties. To use this
argument, you must also specify the profile to assign to the imported
requirement set and link set by using the profile
argument.
Tip
You can create a profile mapping file from a requirement set that
has a profile mapping by using the saveProfileMapping
method.
Example: profileMapping="myMapping.xml"
Import Options for DOORS and Custom Defined Document Types
Name of the attribute from the external document that you want to map
to the Keywords
property for the imported
requirements, specified as a string scalar or character vector.
Example: keywords="Requirement
Keywords"
Name of the attribute from the external document that you want to map
to the Rationale
property for the imported
requirements, specified as a string scalar or character vector.
Example: rationale="Requirement
Rationale"
Examples
This example shows how to create a requirement set and import requirements from a Microsoft Excel spreadsheet to the requirement set.
% Create a new requirement set and save it rs = slreq.new("newReqSet"); save(rs); % Import editable requirements as rich text from a Word document importFromDocument(rs,"C:\Work\Requirements_Spec.docx");
This example shows how to create and save a requirement set.
Then, the example shows how to import requirements by specifying the rows and
columns to import, and the columns to map to the Summary
and
ID
properties of the requirements.
% Create a new requirement set and save it rs = slreq.new("newReqSet"); save(rs); % Import editable requirements from an Excel spreadsheet importFromDocument(rs,"C:\Work\Req_Spec.xlsx", ... columns=[2 6],rows=[3 32],idColumn=2, ... summaryColumn=3);
Version History
Introduced in R2018a
See Also
Classes
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)