Main Content

updateSrcArtifactUri

Class: slreq.ReqSet
Namespace: slreq

Update document resource identifier of imported requirements

Since R2022a

Syntax

updateSrcArtifactUri(rs,oldURI,newURI)

Description

updateSrcArtifactUri(rs,oldURI,newURI) updates the Artifact property from oldURI to newURI for the referenced requirements in the requirement set rs that have Artifact set to oldURI. Use this function to update the external requirements document associated with the imported requirements from non-file-based domains, such as a query URL.

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

Resource identifier for the original external document, specified as a string scalar or character vector.

Resource identifier for the new external document, specified as a string scalar or character vector.

Examples

expand all

This example shows how to update the stored query for requirements that were previously imported to a requirement set called myReqSet.

Get a handle to the requirement set called myReqSet.

rs = slreq.find(Type="ReqSet",Name="myReqSet");

Get a handle to the import node for the requirement set.

topRef = children(rs);

Update the query stored in the Artifact property of the referenced requirements in the requirement set.

oldURI = topRef.Artifact;
newURI = "rm:ofType=%3A9443%2Frm2%2Ftypes%2F_C1KXMwJgEeuFW5Ss3RBk7w%3E";
updateSrcArtifactUri(rs,oldURI,newURI);

Tips

  • To update the file name or path of the referenced requirements in the requirement set when you rename or move an external requirements document file, use updateSrcFileLocation.

  • To change the stored name and path of the external requirements document and update the imported referenced requirements under the import node, use the updateFromDocument method.

  • To update the link destinations for direct links when you rename or move an external requirements document, use the updateDocUri method.

Version History

Introduced in R2022a