Main Content

updateRegisteredReqSets

Class: slreq.LinkSet
Package: slreq

Update requirement sets registered to link set

Syntax

updateRegisteredReqSets(myLinkSet)

Description

updateRegisteredReqSets(myLinkSet) updates the requirement sets registered in the link set myLinkSet. If a currently registered requirement set has incoming links from the link set myLinkSet or if the requirement set is loaded, then it remains registered. Otherwise, the software unregisters the requirement sets from the link set myLinkSet.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

Examples

expand all

This example shows how to get and update the requirement sets registered in a link set.

Open the Requirements Definition for a Cruise Control Model project.

slreqCCProjectStart;

Load the crs_req requirement set, which describes a cruise control system. This action also loads the crs_req link set and the crs_req_func_spec requirement set.

slreq.load("crs_req");

Find the crs_req link set and the crs_req_func_spec requirement set.

myLinkSet = slreq.find("Type","LinkSet","Name","crs_req");
rs = slreq.find("Type","ReqSet","Name","crs_req_func_spec");

Get the requirement sets registered in the crs_req link set.

registeredReqSets = getRegisteredReqSets(myLinkSet)
registeredReqSets = 1x1 cell array
    {'/tmp/Bdoc22a_1891349_100522/bml.batserve.065631/MATLAB/Projects/examples/CruiseRequirementsExample1/documents/crs_req_func_spec.slreqx'}

Get the links from the crs_req link set. Remove all of the links from the crs_req link set and close the crs_req_func_spec requirement set.

links = getLinks(myLinkSet);
for i = 1:numel(links)
    remove(links(i));
end
close(rs);

Update the requirement sets registered to the link set crs_req. Confirm that the requirement set crs_req_func_spec is not registered in the link set crs_req by getting the currently registered requirement sets.

updateRegisteredReqSets(myLinkSet)
registeredReqSets = getRegisteredReqSets(myLinkSet)
registeredReqSets =

  0x0 empty cell array

Cleanup

Clear the open requirement sets and link sets. Close the Requirements Definition for a Cruise Control Model project.

slreq.clear;
close(currentProject);

Tips

  • When you create a link to a requirement, the requirement set of the requirement becomes registered to the link set of the link. If you delete the link to the requirement, you must manually unregister the requirement set from the link set. You can get the currently registered requirement sets for the link set by using getRegisteredReqSets.

  • You can only unregister a requirement set that is not loaded.

  • Loading the link set loads the requirement sets registered to that link set. For more information, see Load Link Information.

Version History

Introduced in R2018a