Main Content

inLinks

Class: slreq.Reference
Namespace: slreq

Get incoming links for referenced requirements

Syntax

myLinks = inLinks(ref)

Description

myLinks = inLinks(ref) returns the incoming links for the referenced requirement ref.

Input Arguments

expand all

Referenced requirement, specified as a slreq.Reference object.

Output Arguments

expand all

Incoming links for the requirement, returned as an slreq.Link array.

Examples

expand all

This example shows how to get incoming and outgoing links for referenced requirements.

Open the MyAdd2 project. Load the myAddReqs and myAddTestSpecification requirement sets.

openProject("MyAdd2");
rs1 = slreq.load("myAddTestSpecification");
rs2 = slreq.load("myAddReqs");

In the MyAdd2 requirement set, find the referenced requirement with index 1.1.

ref = find(rs1,Index="1.1");

In the myAddReqs requirement set, find the requirement with index 4.

req = find(rs2,Index="4");

Create a link from the referenced requirement to the requirement. Set the link type to Refine.

myLink = slreq.createLink(ref,req);
myLink.Type = "Refine";

Get the incoming links for the referenced requirement.

myInLinks = inLinks(ref);

Get the outgoing links for the referenced requirement.

myOutLinks = outLinks(ref);

Tips

  • To get the incoming links for a requirement, use the inLinks method of slreq.Requirement.

Alternative Functionality

App

You can also use the Requirements Editor to view incoming links. Select a referenced requirement. In the right pane, under Links, the incoming links icon indicates incoming links.

Version History

Introduced in R2017b