ExportOptions
Description
Use ExportOptions
objects to configure options when exporting
requirements and links to ReqIF™ files.
Creation
Syntax
Description
creates an myExportOptions
= slreq.export.ExportOptionsExportOptions
object.
creates an myExportOptions
= slreq.export.ExportOptions(Name=Value
)ExportOptions
object and sets writable properties using one or more name-value arguments. For example,
slreq.export.ExportOptions(Template="Generic")
sets the export to map
to a generic template.
Properties
Attributes
— Requirement properties and attributes to export
string array | cell array of character vectors
Requirement properties and attributes to export, specified as a string array or a cell array of character vectors. You can export built-in properties, stereotype properties, or custom attributes by specifying the name of the property or attribute. For stereotype properties, enter the fully qualified name, including the profile name.
Example: Attributes=["Summary","Description"]
Example: Attributes=["My Custom Attribute 1", "My Custom Attribute
2"]
Example: Attributes=["myProfile.myStereotype.myProperty1",
"myProfile.myStereotype.myProperty2"]
Data Types: cell
| string
IncludeLinks
— Whether file include links
false
or 0
(default) | true
or 1
Whether the exported file includes the links associated with the requirement set,
specified as a numeric or logical 0
(false
) or
1
(true
).
Example: IncludeLinks=true
Data Types: logical
MappingFile
— File path of mapping file
character vector
This property is read-only.
File path of the mapping file used during export, returned as a character vector.
Requirements Toolbox™ sets the value of this property when you pass the
ExportOptions
object as an input to the slreq.export
function.
Data Types: char
OutputFile
— Exported file name and directory
""
(default) | string scalar | character vector
Exported ReqIF file name and directory, specified as a string scalar or character vector.
The file name must have the .reqif
or .reqifz
extension. If the requirements contain images and you use the .reqif
extension, the function updates the extension of the file automatically.
Example: OutputFile="myExportedReqIF.reqif"
Data Types: char
| string
Template
— Export mapping
""
(default) | "Generic"
| "IBM DOORS"
| "IBM DOORS Next"
| ...
Export mapping, specified as one of these options:
Value | Description |
---|---|
empty string scalar or character vector | The export uses the mapping of the imported requirement set. Otherwise, the export maps to a generic template. |
"Generic" | The export template maps to a generic template. |
"IBM DOORS" | The export template maps to IBM® DOORS®. |
"IBM DOORS Next" | The export template maps to IBM DOORS Next. |
"Jama Software" | The export template maps to Jama software. |
"Polarion" | The export template maps to Polarion™. |
"PREEvision" | The export template maps to PREEvision. |
Data Types: enum
TemplateFile
— File path of template file
character vector
This property is read-only.
File path of the template file used during export, returned as a character vector.
Requirements Toolbox sets the value of this property when you pass the
ExportOptions
object as an input to the slreq.export
function.
Data Types: char
View
— Requirements Editor view to use
string scalar | character vector
Requirement Editor view to use during export, specified as a string scalar or character vector. The view filters the requirements and links that export based on metadata.
Example: View="myView"
Data Types: char
| string
Object Functions
getFilterableAttributes | Properties and attributes available to export to ReqIF |
verify | Validate ReqIF export options for requirement set |
Examples
Create Export Options
This example shows how to create an empty export options object.
myExportOptions = slreq.export.ExportOptions
myExportOptions = ExportOptions with properties: OutputFile: '' Template: '' IncludeLinks: 0 View: '' Attributes: {}
Specify the name of the exported ReqIF file by setting the OutputFile
property value.
myExportOptions.OutputFile = "myReqIF.reqif"
myExportOptions = ExportOptions with properties: OutputFile: "myReqIF.reqif" Template: '' IncludeLinks: 0 View: '' Attributes: {}
Create and Validate Export Options
This example shows how to create ReqIF export options, get the available properties and custom attributes, specify which properties and attributes to export, and validate the generated export options.
Open the ShortestPath
project.
openProject("ShortestPath");
Load the shortest_path_func_reqs
requirement set.
rs = slreq.open("shortest_path_func_reqs");
Create Export Options
Create an export options object that specifies the output file as shortest_path_func_reqif.reqif
, exports links, and uses a generic export mapping.
myExportOptions = slreq.export.ExportOptions( ... OutputFile="shortest_path_func_reqif.reqif",IncludeLinks=true,Template="Generic")
myExportOptions = ExportOptions with properties: OutputFile: "shortest_path_func_reqif.reqif" Template: "Generic" IncludeLinks: 1 View: '' Attributes: {} MappingFile: '' TemplateFile: ''
Specify Attributes to Export
Get the available attributes to export by using the getFilterableAttributes
function.
attributes = getFilterableAttributes(myExportOptions,rs)
attributes = 1x11 cell
{'Summary'} {'Type'} {'Keywords'} {'CreatedOn'} {'CreatedBy'} {'ModifiedOn'} {'ModifiedBy'} {'Revision'} {'Description'} {'Rationale'} {'Priority'}
Export only the Summary
and Description
properties and the Priority
custom attribute by setting the value for the Attributes
export option property.
myExportOptions.Attributes = ["Summary","Description","Priority"]
myExportOptions = ExportOptions with properties: OutputFile: "shortest_path_func_reqif.reqif" Template: "Generic" IncludeLinks: 1 View: '' Attributes: ["Summary" "Description" "Priority"] MappingFile: '' TemplateFile: ''
Validate Export Options and Export Requirements
Validate the export options object for the shortest_path_func_reqs
requirement set.
status = verify(myExportOptions,rs)
status = logical
1
Export the requirement set to a ReqIF file.
dir = slreq.export(rs,myExportOptions)
dir = 'shortest_path_func_reqif.reqif'
Version History
Introduced in R2023aR2023b: Specify attributes to export and filtered view to use during export
Specify the attributes to export and export only the requirements and links that meet
the filter criteria specified by a Requirements Editor view by using the Attributes
and View
properties, respectively.
R2023b: View mapping file and template file used during export
Return the file path for the mapping file and template file used during export by
viewing the MappingFile
and TemplateFile
properties. The software sets the value of these properties when
you pass the ExportOptions
object as an input to the slreq.export
function.
R2023b: Get available attributes to export
Return the properties and attributes that are available to export by using the getFilterableAttributes
function.
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)