Main Content

updateReferences

Class: slreq.ReqSet
Package: 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.

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.

Open the Requirements Definition for a Cruise Control Model project. Load the crs_req requirement set.

slreqCCProjectStart;
rs = slreq.load("crs_req");

Update the requirement set from the external requirements document crs_req.docx.

[status,changeList] = updateReferences(rs,"crs_req.docx")
status = 
'Update completed. Refer to Comments on Import1.'
changeList = 
    'Updated: ROM. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System outputs. Properties: description
     Updated: Throttle value calculation. Properties: description
     '

Cleanup

Close the requirement sets and link sets without saving the changes. Close the project.

slreq.clear;
close(currentProject);

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

Open the Requirements Definition for a Cruise Control Model project and load the crs_req requirement set.

slreqCCProjectStart;
rs = slreq.load("crs_req");

Find the Import node in the requirement set. The Import node has an Index property set to Import1.

topRef = find(rs,"Index","Import1");

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: ROM. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System outputs. Properties: description
     Updated: Throttle value calculation. Properties: description
     '

Cleanup

Close the requirement sets and link sets without saving the changes. Close the project.

slreq.clear;
close(currentProject);

Tips

  • You can use updateFromDocument to update the referenced requirements under an Import node without specifying the requirement set.

Version History

Introduced in R2017b