Main Content

verify

Validate ReqIF export options for requirement set

Since R2023a

    Description

    example

    status = verify(myExportOptions,reqContent) validates the ReqIF™ export options, myExportOptions, for the requirement set, requirement, or referenced requirement specified by reqContent.

    example

    [status,rs] = verify(myExportOptions,reqContent) returns the requirement set for the requirement, or referenced requirement specified by reqContent.

    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'
    

    This example shows how to validate an export options object for a single requirement and return the requirement set for the requirement.

    Open the ShortestPath project.

    openProject("ShortestPath");

    Load the shortest_path_func_reqs requirement set.

    rs = slreq.load("shortest_path_func_reqs");

    Get a handle to the requirement with the summary Functional behavior.

    req = find(rs,Summary="Functional behavior");

    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: ''
    
    

    Validate the export options object for the requirement. Return the requirement set that the requirement belongs to.

    [status,rs] = verify(myExportOptions,req);

    Input Arguments

    collapse all

    Export options, specified as an ExportOptions object.

    Requirements to export, specified as a string scalar, character vector, a slreq.ReqSet object, a slreq.Reference object, or a slreq.Requirement object. Use a string scalar or character vector to specify the file name of a requirement set.

    Output Arguments

    collapse all

    Validation success status, returned as a 0 or 1 of data type logical.

    Data Types: logical

    Requirement set that the requirement or referenced requirement belongs to, returned as an slreq.ReqSet object.

    Version History

    Introduced in R2023a