Main Content

updateFromDocument

Class: slreq.Reference
Package: slreq

Update referenced requirements from external requirements document

Syntax

[status,changeList] = updateFromDocument(topRef)

Description

[status,changeList] = updateFromDocument(topRef) updates the referenced requirements under the Import node topRef. The function returns the update status and a list of updated requirements.

Input Arguments

expand all

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 check if the import node has an available update and update the referenced requirements.

Open the Requirements Definition for a Cruise Control Model project.

slreqCCProjectStart;

Load the crs_req requirement set.

rs = slreq.load("crs_req");

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

topRef = children(rs);

Check if the import node has an available update.

tf = hasNewUpdate(topRef)
tf = logical
   1

A result of 1 means that topRef has been updated since the last time it was imported. Update the referenced requirements under the import node.

[status,changelist] = updateFromDocument(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 updateReferences to update the referenced requirements in a requirement set by specifying the external requirements document identifier.

Version History

Introduced in R2019a