Customize Requirement Index Numbering
You can disable the index for an individual requirement, referenced requirement, or justification or set the index to a specified value. To customize the index numbering, use the Requirements Editor or set the object properties at the MATLAB® command line.
Disable Index Numbering
Requirement sets in Requirements Toolbox™ contain a hierarchy of requirements. Requirements Toolbox assigns each requirement an index number that identifies what level of the hierarchy the requirement is in and where it is within the level.
You can disable index numbering for an individual requirement, referenced requirement, or justification in the hierarchy. Disabling numbering also disables index numbering for all descendant requirements. However, the requirements, referenced requirements, and justifications remain in the same place in the hierarchy.
To disable index numbering, in the Requirements Editor, right-click the requirement and select Disable index numbering.
To re-enable index numbering, right-click the requirement and select Enable index numbering. However, index numbering for descendant requirements remains disabled. You must individually re-enable index numbering for each descendant requirement.
Tip
You can also re-enable requirement index numbering at the MATLAB command line. For more information, see Programmatically Customize Index Numbering.
Set the Index to a Specified Value
To set the index of a requirement, referenced requirement, or justification to a specified value:
In the Requirements Editor, right-click the requirement and select Set index numbering.
In the Index number dialog box, clear Use default auto numbering. In the Restart numbering from field, enter the desired requirement index value. You can only enter an integer value.
Click OK.
To set the index number back to the default value, right-click the requirement and select Set index numbering. In the Index number dialog box, select Use default auto numbering.
Note
You cannot move a requirement to another level in the hierarchy by specifying the index value. Instead, use Promote Requirement or Demote Requirement in the Requirements Editor toolstrip. You cannot promote or demote referenced requirements.
Programmatically Customize Index Numbering
You can customize the index numbering for slreq.Requirement
, slreq.Reference
, and slreq.Justification
objects at the MATLAB command line. To get a handle to an object, use:
slreq.find
to search the loaded Requirements Toolbox objectsThe
find
method ofslreq.ReqSet
to search in a requirement setslreq.getCurrentObject
to get a handle to the selected object in the Requirements Editor
Disable Index Numbering Programmatically
To disable index numbering programmatically, set the
IndexEnabled
property of the requirement object to
false
.
myReq = slreq.find(Type="Requirement",Summary="My Requirement 1"); myReq.IndexEnabled = false;
To re-enable index numbering programmatically, set the
IndexEnable
property of the requirement object to
true
.
myReq.IndexEnabled = true;
Specify the Index Value Programmatically
To specify the requirement index value programmatically, set the
IndexNumber
property of the requirement object to an
integer number.
myReq = slreq.find(Type="Requirement",Summary="My Requirement 1"); myReq.IndexNumber = 101;
Note
You cannot move the requirement to another level in the hierarchy by specifying the index value. Instead, use:
You cannot move referenced requirements.
Setting the requirement index to a specific value changes the index numbering for the requirements that come after the requirement and any descendant requirements.
To reset the requirement index to the default value, set the
IndexNumber
to an empty
array.
myReq.IndexNumber = [];
Reset Index Numbering for Multiple Requirements Programmatically
You can re-enable index numbering and reset the requirement index to the default value for multiple requirements programmatically.
For example, this script:
Finds a loaded requirement set called
myReqSet
Finds the
slreq.Reference
objects in the requirement setEnables index numbering for all referenced requirements in the requirement set
Resets the index value to the default value for all referenced requirements in the requirement set
rs = slreq.find(Type="ReqSet",Name="myReqSet"); refs = find(rs,Type="Reference"); for i = 1:numel(refs) refs(i).IndexEnabled = true; refs(i).IndexNumber = []; end
slreq.Requirement
, slreq.Reference
, and slreq.Justification
objects as
inputs.function resetDescendantIndex(ref) childRefs = children(ref); for i = 1:numel(childRefs) childRefs(i).IndexEnabled = true; childRefs(i).IndexNumber = []; resetDescendantIndex(childRefs(i)); end end
See Also
Requirements
Editor | slreq.Requirement
| slreq.Reference
| slreq.Justification