Main Content

find

Class: slreq.Justification
Namespace: slreq

Find children of parent justification

Syntax

childJusts = find(jt,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)

Description

childJusts = find(jt,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN) finds and returns child justifications childJusts of the parent justification jt that match the properties specified by PropertyName and PropertyValue.

Input Arguments

expand all

Justification, specified as an slreq.Justification object.

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

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

Justification 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.Justification.

Output Arguments

expand all

Child justifications, returned as slreq.Justification objects.

Examples

expand all

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

Load the crs_req_justs requirement file, which describes a cruise control system, and assign it to a variable. Find the justification with index 5, as this justification has child justifications.

rs = slreq.load("crs_req_justs");
parentReq = find(rs,"Type","Justification","Index","5");

Find the child justifications of parentReq that were modified in revision 1.

childReqs1 = find(parentReq,"FileRevision",1)
childReqs1=1×6 Justification array with properties:
    Id
    Summary
    Description
    Keywords
    Rationale
    CreatedOn
    CreatedBy
    ModifiedBy
    IndexEnabled
    IndexNumber
    SID
    FileRevision
    ModifiedOn
    Dirty
    Comments
    Index

Find the child justifications of parentReq that were modified in revision 1 and whose summary says Non-functional requirement.

childReqs2 = find(parentReq,"FileRevision",1, ...
    "Summary","Non-functional requirement")
childReqs2 = 
  Justification with properties:

              Id: '#72'
         Summary: 'Non-functional requirement'
     Description: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">...'
        Keywords: {}
       Rationale: ''
       CreatedOn: 27-Feb-2017 10:34:22
       CreatedBy: 'itoy'
      ModifiedBy: 'asriram'
    IndexEnabled: 1
     IndexNumber: []
             SID: 72
    FileRevision: 1
      ModifiedOn: 03-Aug-2017 17:14:44
           Dirty: 0
        Comments: [0x0 struct]
           Index: '5.1'

Tips

  • To search the loaded Requirements Toolbox objects, use the slreq.find function.

  • To search the children of a requirement, use the find method of slreq.Requirement

  • To search the children of a requirements set, use the find method of slreq.ReqSet.

  • To search the children of a link set, use the find method of slreq.LinkSet.

  • To search the children of a reference, use the find method of slreq.Reference.

Version History

Introduced in R2018b