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 update referenced requirements from an external requirements document.

Load a requirement set file called My_Requirement_Set_1.

rs = slreq.load("C:\MATLAB\My_Requirement_Set_1.slreqx");

Find the referenced requirements in the requirement set.

allRefs = find(rs,"Type","Reference")
allRefs = 

  1×46 Reference array with properties:

    Id
    CustomId
    Artifact
    ArtifactId
    Domain
    UpdatedOn
    CreatedOn
    CreatedBy
    ModifiedBy
    IsLocked
    Summary
    Description
    Rationale
    Keywords
    Type
    SID
    FileRevision
    ModifiedOn
    Dirty
    Comments

The Import node is the first referenced requirement in the array. Update the referenced requirements underneath the Import node.

[status,changeList] = updateFromDocument(allRefs(1))
status =

    'Update completed. Refer to Comments on Import1.'


changeList =

    'Updated: Robot Arm Sensor. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System Outputs. 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