Main Content

updateReferences

Class: slreq.ReqSet
Namespace: slreq

Update referenced requirements in requirement set

Syntax

[status,changeList] = updateReferences(rs,docID)
[status,changeList] = updateReferences(rs,topRef)

Description

[status,changeList] = updateReferences(rs,docID) updates the referenced requirements in the requirement set rs by using the external requirements document specified by docID. The function returns the update status and a list of changes made to the requirements.

[status,changeList] = updateReferences(rs,topRef) updates the referenced requirements under the Import node topRef in the requirement set rs. The function updates the referenced requirements by using the external document associated with the Import node.

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

Identifier of the external requirements document associated with the requirement set, specified as a string scalar or a character vector.

Note

The docID must match the Artifact property for the import node, topRef. If the document name does not match the Artifact property of the import node, use the updateFromDocument method to update the referenced requirements.

Example: "requirement_spec.docx"

Import node, specified as an slreq.Reference object.

Output Arguments

expand all

Requirement set update status, returned as a character vector.

List of updated referenced requirements, returned as a character vector. The list includes the properties of each referenced requirement changed by the function.

Examples

expand all

This example shows how to update a requirement set from an external requirements document. You can only run this example on Windows® platforms.

Load the MyRequirementSpecification requirement set, which was imported from the MyRequirementSpecification.docx Microsoft® Word document.

rs = slreq.load("MyReqSpecification");

Update the requirement set from the MyRequirementSpecification.docx document.

[status,changeList] = updateReferences(rs,"MyReqSpecification.docx")
status = 
'Update completed. Refer to Comments on Import1.'
changeList = 
    'Updated: Parent Requirement 1. Properties: description
     Updated: Parent Requirement 2. Properties: description
     '

This example shows how to update referenced requirements in a requirement set from an Import node.

Load the MyRequirementSpecification requirement set, which was imported from the MyRequirementSpecification.docx Microsoft® Word document.

rs = slreq.load("MyReqSpecification");

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

topRef = children(rs);

Update the requirement set from the external requirements document associated with the Import node.

[status,changeList] = updateReferences(rs,topRef)
status = 
'Update completed. Refer to Comments on Import1.'
changeList = 
    'Updated: Parent Requirement 1. Properties: description
     Updated: Parent Requirement 2. Properties: description
     '

Tips

  • To update the referenced requirements under an import node without specifying the requirement set, use the updateFromDocument method. Additionally, you can use the updateFromDocument to update the referenced requirements when you change the name or path of the external requirements document.

Version History

Introduced in R2017b