Main Content

slreq.map

Get or set path to link set file

    Description

    slreq.map(source,linkSet) associates the link set linkSet with the source artifact source.

    example

    linkSetFilePath = slreq.map(source) returns the link set path for the source artifact source.

    example

    slreq.map(source,"undo") reverts the mapping to the previously stored mapping for the source artifact source.

    example

    slreq.map(source,"clear") clears the previously stored mappings for the source artifact source.

    example

    Examples

    collapse all

    This example shows how to map a link set file to a model, clear the link set mapping, and map a new link set to the model.

    Define the source artifact and link set.

    source = fullfile(pwd,"slvnvdemo_powerwindowController.slx");

    Review the file path for the mapped link set.

    linkSet = slreq.map(source)
    linkSet = 
    'C:\Users\jdoe\MATLAB\Examples\slrequirements-ex26775930\slvnvdemo_powerwindowRequirements.slmx'
    

    Define a new link set and map the model to the link set.

    newLinkSet = fullfile(pwd, "slvnvdemo_powerwindowRequirements.slmx");
    slreq.map(source, newLinkSet);

    Clear all existing mappings.

    slreq.map(source,"clear");
    Removing all mapping for ...\slvnvdemo_powerwindowController.slx
    

    This example shows how to map a link set file with MATLAB code and how to revert the mapping.

    Define the source artifact and link set.

    source = fullfile(pwd,"myAdd.m");
    linkSet = fullfile(pwd,"myAddLinks1.slmx");

    Map the source artifact to the link set file.

    slreq.map(source,linkSet);

    Map the source artifact to a new link set file..

    newLinkSet = fullfile(pwd,"myAddLinks2.slmx");
    slreq.map(source,newLinkSet);
    Mapping ...\myAdd.m to ...\myAddLinks2.slmx
    

    Undo the mapping to newLinkSet to revert the mapping to the previous value.

    slreq.map(source,"undo");
    Removing C:\Users\jdoe\MATLAB\Examples\slrequirements-ex69996110\myAddLinks2.slmx for ...\myAdd.m
    
    slreq.map(source)
    ans = 
    'C:\Users\jdoe\MATLAB\Examples\slrequirements-ex69996110\myAddLinks1.slmx'
    

    Input Arguments

    collapse all

    Path of the source artifact file, specified as a string scalar or character vector.

    Data Types: char | string

    Path of the link set file, specified as a string scalar or character vector.

    Data Types: char | string

    Output Arguments

    collapse all

    Full path of the mapped link set file, returned as a character vector.

    More About

    collapse all

    Version History

    Introduced in R2018a