Main Content

slreq.getNavigationFcn

Get registered navigation function for referenced requirements

    Description

    example

    callbackFunction = slreq.getNavigationFcn(domain) returns the navigation callback function name registered for imported referenced requirements that have the Domain property value equal to domain.

    Examples

    collapse all

    This example shows how to register and get the registered navigation callback function for referenced requirements imported from ReqIF™ files.

    Import the ReqIF file mySpec.reqif into Requirements Toolbox™.

    count = slreq.import("mySpec.reqif");

    Get the handle for the imported requirement set. Check the domain for the imported referenced requirements.

    rs = slreq.find("Type","ReqSet","Name","mySpec");
    topRef = children(rs);
    domain = topRef.Domain
    domain = 
    'Third-Party Tool'
    

    Check if there are any currently registered navigation callback functions for the domain.

    callback = slreq.getNavigationFcn(domain)
    callback =
    
      0x0 empty char array
    

    Register the custom navigation callback function myNavigationFcn for the domain. Confirm that the navigation callback function was registered.

    slreq.registerNavigationFcn(domain,"myNavigationFunction")
    callback = slreq.getNavigationFcn(domain)
    callback = 
    'myNavigationFunction'
    

    Cleanup

    Clear the open requirement sets without saving. Unregister the custom navigation callback function.

    slreq.clear;
    slreq.registerNavigationFcn(domain,'');

    Input Arguments

    collapse all

    Third-party requirements tool domain for which to get the registered the navigation callback function, specified as a string scalar.

    Output Arguments

    collapse all

    Registered navigation callback function name, returned as a character vector.

    Tips

    • You can get the value of the Domain property for a referenced requirement at the MATLAB® command prompt by entering:

      domain = myReferencedRequirement.Domain
      domain =
      
          'Third-Party Tool'

    Version History

    Introduced in R2019a