Main Content

getReferenceInfo

Class: slreq.Link
Namespace: slreq

Get unresolved link destination

Syntax

destInfo = getReferenceInfo(myLink)

Description

Use this function to get link destination information when the link destination is unresolved.

destInfo = getReferenceInfo(myLink) returns information about the destination for the link myLink.

Input Arguments

expand all

Link, specified as an slreq.Link object.

Output Arguments

expand all

Link destination information, returned as a MATLAB® structure that contains these fields:

  • domain

  • artifact

  • id

Examples

expand all

This example shows how to investigate unresolved link destination.

Open the ShortestPath project.

openProject("ShortestPath");

Load the shortest_path_test_reqs requirement set, which also loads the graph_unit_tests link set.

rs = slreq.load("shortest_path_tests_reqs");
myLinkSet = slreq.find(Type="LinkSet");

Get the links from the link set. Get the 15th link in the link set.

linksArray = getLinks(myLinkSet);
myLink = linksArray(15);

Check if the link destination is resolved.

tf = isResolvedDestination(myLink)
tf = logical
   0

Get the information about the unresolved link destination.

destInfo = getReferenceInfo(myLink)
destInfo = struct with fields:
      domain: 'linktype_rmi_slreq'
    artifact: 'shortest_path_func_reqs.slreqx'
          id: '5'

Load the requirement set that the link destination belongs to, then check if the link destination is resolved.

rs = slreq.load(destInfo.artifact);
tf = isResolvedDestination(myLink)
tf = logical
   1

Tips

  • To get link destination information when the link destination is resolved, use destination.

  • To check if the link destination is resolved, use isResolvedDestination.

Version History

Introduced in R2018b