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 CruiseRequirementsExample 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: CC003_01. Properties: description
     Updated: CC003_02. Properties: description
     Updated: CC003_03. Properties: description
     Updated: CC003_04. Properties: description
     Updated: Cruise control buttons. Properties: description
     Updated: Cruise control mode indicator. Properties: description
     Updated: Cruise control modes. Properties: description
     Updated: Dashboard image. Properties: description
     Updated: Deactivating cruise control. Properties: description
     Updated: Disabling cruise control. Properties: description
     Updated: Enabling cruise control. Properties: description
     Updated: Other inputs. Properties: description
     Updated: ROM. Properties: description
     Updated: Resuming cruise control. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System outputs. Properties: description
     Updated: Throttle value calculation. Properties: description
     '

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

Open the CruiseRequirementsExample 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: CC003_01. Properties: description
     Updated: CC003_02. Properties: description
     Updated: CC003_03. Properties: description
     Updated: CC003_04. Properties: description
     Updated: Cruise control buttons. Properties: description
     Updated: Cruise control mode indicator. Properties: description
     Updated: Cruise control modes. Properties: description
     Updated: Dashboard image. Properties: description
     Updated: Deactivating cruise control. Properties: description
     Updated: Disabling cruise control. Properties: description
     Updated: Enabling cruise control. Properties: description
     Updated: Other inputs. Properties: description
     Updated: ROM. Properties: description
     Updated: Resuming cruise control. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System outputs. Properties: description
     Updated: Throttle value calculation. Properties: description
     '

Tips

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

Version History

Introduced in R2017b