Main Content

find

Class: slreq.Reference
Package: slreq

Find children of parent referenced requirements

Syntax

childRefs = find(ref,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)

Description

childRefs = find(ref,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN) finds and returns child referenced requirements childRefs of the parent referenced requirement ref that match the properties specified by PropertyName and PropertyValue.

Input Arguments

expand all

Referenced requirement, specified as an slreq.Reference object.

Reference property name, specified as a character vector. See the valid property names in the Properties section of slreq.Reference.

Example: 'Type','Keywords','SID'

Reference property value, specified as a character vector, character array, datetime value, scalar, logical, or structure array. The data type depends on the specified propertyName. See the valid property values in the Properties section of slreq.Reference

Output Arguments

expand all

Child referenced requirements, returned as slreq.Reference objects.

Examples

expand all

This example shows how to find child referenced requirements that match property values.

Load the crs_req requirement file, which describes a cruise control system, and assign it to a variable. Find the referenced requirement with index 3, as this referenced requirement has child referenced requirements.

rs = slreq.load('crs_req');
parentRef = find(rs,'Type','Reference','Index','3')
parentRef = 
  Reference with properties:

              Id: 'Functional Requirements'
        CustomId: 'Functional Requirements'
        Artifact: 'crs_req.docx'
      ArtifactId: '?Functional Requirements'
          Domain: 'linktype_rmi_word'
       UpdatedOn: 02-Feb-2018 13:23:13
       CreatedOn: NaT
       CreatedBy: ''
      ModifiedBy: ''
        IsLocked: 1
         Summary: 'Functional Requirements'
     Description: '<div class=WordSection1>...'
       Rationale: ''
        Keywords: {}
            Type: 'Functional'
             SID: 9
    FileRevision: 1
      ModifiedOn: 03-Aug-2017 17:34:56
           Dirty: 0
        Comments: [0x0 struct]
           Index: '3'

Find all the child referenced requirements of parentRef that were modified in revision 1.

childRefs1 = find(parentRef,'FileRevision',1)
childRefs1=1×18 object
  1x18 Reference array with properties:

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

Find all the child referenced requirements of parentRef that were modified in revision 1 and have an SID equal to 12.

childRefs2 = find(parentRef,'FileRevision',1,'SID',12)
childRefs2 = 
  Reference with properties:

              Id: 'Activating cruise control'
        CustomId: 'Activating cruise control'
        Artifact: 'crs_req.docx'
      ArtifactId: '?Activating cruise control'
          Domain: 'linktype_rmi_word'
       UpdatedOn: 02-Feb-2018 13:23:13
       CreatedOn: NaT
       CreatedBy: ''
      ModifiedBy: ''
        IsLocked: 1
         Summary: 'Activating cruise control'
     Description: '<div class=WordSection1>...'
       Rationale: ''
        Keywords: {}
            Type: 'Functional'
             SID: 12
    FileRevision: 1
      ModifiedOn: 03-Aug-2017 17:34:56
           Dirty: 0
        Comments: [0x0 struct]
           Index: '3.3'

Cleanup

Clear the open requirement sets and link sets, and close the open models without saving changes.

slreq.clear;
bdclose all;
Introduced in R2018a