Main Content

slreq.Link Class

Namespace: slreq

Traceable link

Description

Use objects of the slreq.Link class to create traceable links between requirements, designs, and tests. Requirements Toolbox™ creates slreq.Link objects when you establish a traceable association between items.

Creation

Create an slreq.Link object by using the slreq.createLink function.

Properties

expand all

The date on which the link was created, specified as a datetime value. The software populates this property.

The name of the individual or organization who created the link.

The date on which the link was last modified, specified as a datetime value. The software populates this property.

The name of the individual or organization who last modified the link.

The comments that are attached with the link, returned as a structure.

Link type enumeration, specified as one of the options in the table:

TypeDescription
"Relate"
  • General relationship between items for most use cases

  • Bi-directional link

"Implement"
  • Specifies the source item that implements the requirement

  • Contributes to the implementation status

For more information, see Track Requirement Links by Using Implementation Status.

"Verify"
  • Specifies which source item verifies the requirement

  • Contributes to the verification status if the source item is one of the accepted item types

For more information, see Review Requirements Verification Status.

"Derive"Specifies which source item derives the destination item
"Refine"Specifies which source item adds detail for the functionality specified by the destination item
"Confirm"
  • Specifies relationship between a requirement and an external test result source

  • Can contribute to the verification status in certain cases

For more information, see Include Results from External Sources in Verification Status.

string scalar or character vectorString scalar or character vector that specifies a custom link type or stereotype. For more information, see Define Custom Requirement and Link Types and Properties.

For more information, see Link Types.

Link descriptive text, specified as a multi-line character vector.

Link keywords, specified as character array.

Link rationale text, specified as a multiline character vector.

The Session Independent Identifier corresponding to the link.

Link revision number, returned as a scalar. When you create a new link, the Revision property matches the link set revision number. When you modify a link and save the link set, the link set revision number increments by one and the Revision property updates to match the new link set revision number. The Revision property updates only when you save changes to the link.

For more information on link set revisions, see slreq.LinkSet.

Methods

addCommentAdd comments to links
clearChangeIssuesClear link change issue
destination Get link destination
getAttributeGet link property values
getChangeInformationGet link change information
getDestinationLabelGet label that identifies link destination
getDestinationOpenCommand Retrieve command that opens link destination
getDestinationURL Retrieve URL that opens link destination
getIncomingTypeLabel Get type label for incoming link
getOutgoingTypeLabel Get type label for outgoing link
getReferenceInfoGet unresolved link destination
getSourceLabelGet label that identifies link source
getSourceOpenCommand Retrieve command that opens link source
getSourceURL Retrieve URL that opens link source
hasChangedDestination Determine if link destination has changes
hasChangedSource Determine if link source has changes
isFilteredInCheck filtered links
isResolved Check if the link is resolved
isResolvedDestination Check if the link destination is resolved
isResolvedSource Check if the link source is resolved
linkSetGet link set for link
removeDelete links
setAttributeSet link property values
setDestination Set requirement link destination
setSource Set requirement link source
source Get link source

Examples

collapse all

This example shows how to create a link.

Open the ShortestPath example.

openProject("ShortestPath");

Load the shortest_path_tests_reqs requirement set.

rs = slreq.load("shortest_path_tests_reqs");

Get a handle to the requirement with the index 2.1.3.

req = find(rs,Index="2.1.3");

Find the line range associated with line number four in the graph_unit_tests MATLAB® code file.

lr = slreq.getTextRange("graph_unit_tests.m",4);

Create a link between the requirement and the line of code in the MATLAB file.

myLink = slreq.createLink(req,lr);

Get a handle to the link set, then save it.

myLinkSet = linkSet(myLink);
tf = save(myLinkSet)
tf = logical
   1

This example shows how to determine the incoming link for a requirement and outgoing link for a model object.

Load the reqs_validation_property_proving_original_model model and the original_thrust_reverser_requirements requirement set.

load_system("reqs_validation_property_proving_original_model");
rqset = slreq.load("original_thrust_reverser_requirements.slreqx");

Get a handle to requirement with the index 11 in the requirement set.

req = slreq.find(Type="Requirement",Index=11);

Get the incoming links for the requirement.

inLinks = slreq.inLinks(req);

Get the link source for the incoming link.

lkSrc = source(inLinks);

Convert the link source from a structure to a model object.

mo = slreq.structToObj(lkSrc);

Get the outgoing links for the model object.

outLinks = slreq.outLinks(mo);

Version History

Introduced in R2018a