Main Content

Load and Resolve Links

When you open or load an artifact that has incoming or outgoing links, Requirements Toolbox™ loads the link sets that contain those links. If the link sets have registered requirement sets, the software also loads those requirement sets. Loading registered requirement sets can further load links if the requirement set has incoming or outgoing links to additional artifacts.

When you load links, the software may identify unresolved links where the source or destination item are not available. You can resolve links by loading the artifact that contains the unloaded item or by repairing the link manually.

Load Artifacts and Associated Link Sets

When you load artifacts such as requirement sets, Simulink® models, or MATLAB® code that have incoming or outgoing links, Requirements Toolbox loads the link sets that contain those links.

For example:

  1. At the MATLAB command line, enter this command to open a project:

    slreqShortestPathProjectStart

  2. Open the shortest_path_func_reqs requirement set. At the MATLAB command line, enter:

    slreq.open("shortest_path_func_reqs");
    The shortest_path_func_reqs requirement set has outgoing links to MATLAB code ranges in shortest_path.m and graph_unit_tests.m.

  3. View the loaded link sets. In the Requirements Editor, click Show Links. The software loaded the link sets associated with shortest_path.m and graph_unit_tests.m.

    The Requirements Editor links view shows that shortest_path.slmx and graph_unit_tests.slmx are loaded.

Load Registered Requirement Sets

When you create a link to a requirement, the requirement set that contains the requirement becomes registered to the link set. You can view the registered requirement sets for a link set by using the getRegisteredReqSets method.

When you load a link set that has registered requirements, Requirements Toolbox also loads those requirement sets. If those requirement sets have links to additional artifacts, the software also loads the link sets that contain those links.

For example:

  1. Clear the loaded requirement sets and link sets by entering this command at the MATLAB command line:

    slreq.clear

  2. Open a project by entering this command at the MATLAB command line:

    slreqShortestPathProjectStart

  3. Open the graph_unit_tests.m MATLAB code file. At the MATLAB command line, enter:

    edit graph_unit_tests.m
    The graph_unit_tests.m file has outgoing links to requirements.

  4. View the loaded link sets. Open the Requirements Editor.

    slreq.editor
    In the Requirements Editor, click Show Links. The software loaded graph_unit_tests.slmx, which is the link set that contains the outgoing links from graph_unit_tests.m.

    The Requirements Editor links view shows that the shortest_path.slmx and graph_unit_tests.slmx link sets are loaded.

    The graph_unit_tests.m file has outgoing links to the shortest_path_tests_reqs and shortest_path_func_reqs requirement sets, so they are registered to the graph_unit_tests link set.

  5. View the loaded requirement sets. In the Requirements Editor, click Show Requirements. Because the shortest_path_tests_reqs and shortest_path_func_reqs requirement sets are registered to the graph_unit_tests link set, they software also loaded them.

    The Requirements Editor requirements view shows that the shortest_path_tests_reqs and shortest_path_func_reqs requirement sets are loaded.

    The shortest_path_func_reqs requirement set also has incoming links from shortest_path.m stored in shortest_path.slmx.

  6. View the loaded link sets again. In the Requirements Editor, click Show Links. Because the software loaded the shortest_path_func_reqs requirement set, it also loaded the link set that contains its incoming links, shortest_path.slmx.

    The Requirements Editor links view shows that the shortest_path.slmx and graph_unit_tests.slmx link sets are loaded.

Unregister Requirement Sets

To unregister a requirement set from a link set, use the updateRegisteredReqSets method. You can only unregister a requirement set from a link set if the requirement set has no incoming links stored in the link set.

Unresolved Links

An unresolved link has a source item or destination item that is not available. The source or destination items can be unavailable because:

  • The artifact that contains the source or destination item is not loaded.

    For example, if you load a requirement set that has incoming links from a Simulink model, this also loads the link set that belongs to the model. However, if you do not load the Simulink model, the links are unresolved.

  • The artifact is loaded, but the specified ID does not exist. Links with invalid IDs are called broken links.

    For example, if you delete a linked requirement, the link becomes unresolved because the stored ID no longer corresponds to a valid item.

To see the unresolved links, in the Requirements Editor, click Show Links. Unresolved links have the unresolved link icon .

Resolve Links

To resolve a link with an unloaded source or destination, load the artifact that contains the unloaded source or destination. You might be able to load the artifact by selecting the link in the Requirements Editor and, in the right pane, under Properties, click the source or destination item that has a warning icon .

To resolve a broken link, identify the location of the link source or destination, then use the setSource and setDestination methods to repair the link. Alternatively, delete the link and re-create it.

Unload Link Information

To unload link sets from memory, close both the source and destination artifacts that contain the linked items. If you close only the source artifact or only the destination artifact, the links remain loaded.

Alternatively, you can unload link sets by using the slreq.clear function to clear the loaded requirement sets and link sets and close the Requirements Editor and Traceability Matrix windows.

See Also

| |

Related Topics