Main Content

add

Class: slreq.Reference
Package: 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® Rational® 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.

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 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: 16-Sep-2021 14:56:35
       CreatedOn: 16-Sep-2021 14:56:35
       CreatedBy: ''
      ModifiedBy: ''
        IsLocked: 1
         Summary: ''
     Description: ''
       Rationale: ''
        Keywords: {}
            Type: 'Functional'
             SID: 32
    FileRevision: 1
      ModifiedOn: 16-Sep-2021 14:56:35
           Dirty: 0
        Comments: [0×0 struct]
           Index: '3.13'

Cleanup

Discard the requirement set without saving the changes. Clear the remaining requirement sets and link sets. Close the project.

discard(rs);
slreq.clear;
close(currentProject);

Tips

Version History

Introduced in R2018a