Main Content

ExportOptions

Options for exporting requirements to ReqIF files

Since R2023a

Description

Use ExportOptions objects to configure options when exporting requirements and links to ReqIF™ files.

Creation

Description

myExportOptions = slreq.export.ExportOptions creates an ExportOptions object.

myExportOptions = slreq.export.ExportOptions(Name=Value) creates an 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.

example

Properties

expand all

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

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

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

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

Export mapping, specified as one of these options:

ValueDescription
empty string scalar or character vectorThe 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

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

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

getFilterableAttributesProperties and attributes available to export to ReqIF
verifyValidate ReqIF export options for requirement set

Examples

collapse all

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: {}

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 R2023a

expand all