find
Class: slreq.Reference
Package: slreq
Find children of parent referenced requirements
Syntax
childRefs = find(ref,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)
Description
finds and returns child referenced requirements childRefs
= find(ref
,'PropertyName1'
,PropertyValue1
,...,'PropertyNameN'
,PropertyValueN
)childRefs
of the
parent referenced requirement ref
that match the properties
specified by PropertyName
and
PropertyValue
.
Input Arguments
ref
— Referenced requirement
slreq.Reference
object
Referenced requirement, specified as an slreq.Reference
object.
PropertyName
— Reference property
character vector
Reference property name, specified as a character vector. See the valid
property names in the Properties section of slreq.Reference
.
Example: 'Type','Keywords','SID'
PropertyValue
— Reference property value
character vector | character array | datetime
value | scalar | logical
| structure array
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
childRefs
— Child referenced requirements
slreq.Reference
object | slreq.Reference
object array
Child referenced requirements, returned as
slreq.Reference
objects.
Examples
Find Child Referenced Requirements
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' IndexEnabled: 1 IndexNumber: [] 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
IndexEnabled
IndexNumber
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' IndexEnabled: 1 IndexNumber: [] 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;
Version History
Introduced in R2018a
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)