Main Content

getFilterableAttributes

Properties and attributes available to export to ReqIF

Since R2023b

Description

attributes = getFilterableAttributes(myExportOptions,rs) returns the properties and attributes that you can export for the requirement set specified by rs and the export options specified by myExportOptions.

example

Examples

collapse all

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'

Input Arguments

collapse all

Export options, specified as an ExportOptions object.

Requirement set, specified as an slreq.ReqSet object.

Output Arguments

collapse all

Properties and attributes available to exclude from export, returned as a cell array of character vectors.

Version History

Introduced in R2023b