Main Content

updateBacklinks

Class: slreq.LinkSet
Namespace: slreq

Synchronize external navigation links

Since R2022a

Syntax

[checked,added] = updateBacklinks(myLinkSet)
[checked,added,removed] = updateBacklinks(myLinkSet,removeUnmatched)

Description

[checked,added] = updateBacklinks(myLinkSet) synchronizes backlinks in external documents to match links in the link set myLinkSet. The method returns the number of links in the link set that the method checked and the number of backlinks it added to the external document.

[checked,added,removed] = updateBacklinks(myLinkSet,removeUnmatched) removes backlinks from the external document that do not have a corresponding link in the link set when removeUnmatched is true. The method returns the number of backlinks removed from the external document.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

Option to remove the unmatched backlinks from the external document, specified as a 1 or 0 of data type logical.

Output Arguments

expand all

Number of links in the link set that the method checked, returned as a double.

Number of backlinks the method added to the external document, returned as a double.

Number of backlinks the method removed from the external document, returned as a double.

Examples

expand all

This example shows how to update backlinks for a Microsoft® Word document by using updateBacklinks.

Open the crs_req_func_spec requirement set. The requirement set has outgoing links to the crs_req.docx document.

rs = slreq.open("crs_req_func_spec");
myLinkSet = slreq.find(Type="LinkSet",Name="crs_req_func_spec");

Update the backlinks for the external documents associated with the link set. Remove the unmatched backlinks from the external documents.

[checked,added,removed] = updateBacklinks(myLinkSet,true)
checked = 14
added = 4
removed = 1

Alternatives

App

You can also update backlinks by using the Requirements Editor. For more information, see Manage Navigation Backlinks in External Requirements Documents.

Version History

Introduced in R2022a