Main Content

add

Class: slreq.Reference
Namespace: slreq

Add child referenced requirement

Syntax

refChild = add(ref,"Artifact",FileName)
refChild = add(ref,"Artifact",FileName,PropertyName,PropertyValue,...,PropertyNameN,PropertyValueN)

Description

refChild = add(ref,"Artifact",FileName) adds a child referenced requirement under the referenced requirement ref that references requirements in the external document, FileName.

refChild = add(ref,"Artifact",FileName,PropertyName,PropertyValue,...,PropertyNameN,PropertyValueN) adds a child referenced requirement with properties and property values specified by PropertyName and PropertyValue.

Input Arguments

expand all

Referenced requirement, specified as an slreq.Reference object.

External requirements document identifier, specified as a string scalar or character vector. Examples of a document identifier are a Microsoft® Office document name or an IBM® DOORS® Module unique ID.

Referenced requirement property name, specified as an string scalar or a character vector.

You can only enter an slreq.Reference property where the SetAccess attribute is public.

Example: "Summary"

Referenced requirement property value, specified as an string scalar or a character vector.

Output Arguments

expand all

New referenced child requirement, returned as an slreq.Reference object.

Examples

expand all

This example shows how to add a child referenced requirement under a referenced requirement.

Load the crs_req requirement set.

rs = slreq.load("crs_req");

Find the top-level referenced requirement with the summary Functional Requirements. Add a child referenced requirement under that referenced requirement that uses the same external document as the top-level referenced requirement.

topRef = find(rs,"Summary","Functional Requirements");
childRef = add(topRef,"Artifact",topRef.Artifact)
childRef = 
  Reference with properties:

              Id: ''
        CustomId: ''
        Artifact: 'crs_req.docx'
      ArtifactId: ''
          Domain: 'linktype_rmi_word'
       UpdatedOn: 17-Apr-2023 16:07:41
       CreatedOn: 17-Apr-2023 16:07:41
       CreatedBy: ''
      ModifiedBy: ''
        IsLocked: 1
         Summary: ''
     Description: ''
       Rationale: ''
        Keywords: {}
            Type: 'Functional'
    IndexEnabled: 1
     IndexNumber: []
             SID: 32
    FileRevision: 1
      ModifiedOn: 17-Apr-2023 16:07:41
           Dirty: 0
        Comments: [0×0 struct]
           Index: '3.13'

Tips

  • To add a top-level requirement to a requirement set, use the add method of slreq.ReqSet. To add a requirement as a child of another requirement, use the add method of slreq.Requirement. To add a justification as a child of another justification, use the add method of slreq.Justification.

Version History

Introduced in R2018a