Main Content

setDestination

Class: slreq.Link
Namespace: slreq

Set requirement link destination

Description

setDestination(myLink,dest) sets the link destination to the item specified by dest for the link myLink.

example

Input Arguments

expand all

Link, specified as an slreq.Link object.

Link destination item, specified as a:

Examples

expand all

This example shows how to find and repair broken links.

Load the myAddRequirements requirement set, which links to lines of code in myAddBroken.m.

rs = slreq.load("myAddBroken");

Get a handle to the link set.

myLinkSet = slreq.find(Type="LinkSet");

Find the broken links in the link set. Display the number of broken links.

brokenLinks = getBrokenLinks(myLinkSet);
numBrokenLinks = numel(brokenLinks)
numBrokenLinks = 
1

Get a handle to the requirement that has the Summary property set to Add u and v.

req = slreq.find(Type="Requirement",Summary="Add u and v");

Repair the broken link by using the setDestination method.

setDestination(brokenLinks(1),req)

Confirm that there are no broken links.

brokenLinks = getBrokenLinks(myLinkSet)
brokenLinks =

     []

Version History

Introduced in R2019b