Main Content

updateRegisteredReqSets

Class: slreq.LinkSet
Namespace: 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, 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 CruiseRequirementsExample project.

openProject("CruiseRequirementsExample");

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);

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 =

  0×0 empty cell array

Tips

  • When you create a link to a requirement, the requirement set of the requirement becomes registered to the link set of the link. You can get the currently registered requirement sets for the link set by using getRegisteredReqSets. For more information, see Load Registered Requirement Sets.

  • 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 and Resolve Links.

Version History

Introduced in R2018a