Main Content

slreq.LinkSet class

Package: slreq

Work with link sets

Description

Instances of slreq.LinkSet are Link Set objects. Links are organized in link sets. Each link set is associated with a source artifact such as a Simulink® model or a data dictionary and is serialized into a separate file which stores the links associated with it. The default location and name of the link set file matches that of the source artifact.

Creation

allLinkSets = slreq.find('Type', 'LinkSet') finds and returns an array of loaded slreq.LinkSet objects allLinkSets.

myLinkSet = slreq.find('Type', 'LinkSet', 'Name', ArtifactName) finds and returns an slreq.LinkSet object myLinkSet matching the artifact name specified by ArtifactName.

myLinkSet = slreq.load(ArtifactName) loads an slreq.LinkSet object myLinkSet matching the artifact name specified by ArtifactName.

Input Arguments

expand all

The name of the link set artifact, specified as a character vector.

Output Arguments

expand all

Array of loaded link sets.

Link set, returned as an slreq.LinkSet object.

Properties

expand all

File path of the link set, specified as a character vector. By default, the link set is stored in the same folder as the artifact and has the same base file name and an .slmx extension.

Artifact that contains the link sources for the link set, specified as a character vector. When you create a link, the link set is associated with the artifact that the link source item belongs to. By default, the link set is stored in the same folder as the artifact and has the same base file name and an .slmx extension. For more information, see Requirements Link Storage. The artifact can be any file that contains a linkable item, such as a Simulink model or a Simulink Test™ file.

The custom link type of the links in the link set. For more information, see Custom Link Types.

Example: linktype_rmi_excel, linktype_rmi_doors

Link set revision number, specified as a scalar.

Indicates if the link set has unsaved changes. 0 for no unsaved changes and 1 for unsaved changes.

Link set description text, specified as a character vector.

Link set custom attribute names, specified as a cell array of character vectors.

Methods

addAttributeAdd custom attribute to link set
createTextRangeCreate line ranges
deleteAttributeDelete custom attribute from link set
exportToVersionExport link set to previous MATLAB version
findFind links in link set with matching attribute values
getLinksGet links from link set
getRegisteredReqSetsGet requirement sets registered in link set
getTextRangeGet line ranges
getTextRangesGet lines ranges that span multiple lines
importProfileAssign profile to ink set
inspectAttributeGet information about link set custom attribute
profilesGet profiles assigned to link set
redirectLinksToImportedReqsRedirect link destination from external document to imported requirement set
removeProfileRemove profile from link set
save Save link set
sources Get link sources
updateAttributeUpdate information for link set custom attribute
updateBacklinksSynchronize external navigation links
updateDocUriUpdate link destination for direct links
updateRegisteredReqSetsUpdate requirement sets registered to link set

Examples

collapse all

This example shows how to find, load, and edit a link set.

Find a loaded link set by using the name.

myLinkSet1 = slreq.find("Type","LinkSet","Name","Project_req")
myLinkSet1 = 

  LinkSet with properties:

    Description: ''
       Filename: 'Project_req.slmx'
       Artifact: 'Project_req.slreqx'
         Domain: 'linktype_rmi_slreq'
       Revision: 2
          Dirty: 0

Load a link set associated with a Simulink model called fuelsys.

myLinkSet2 = slreq.load("fuelsys.slx")
myLinkSet2 = 

  LinkSet with properties:

    Description: ''
       Filename: 'C:\MATLAB\My_Files\fuelsys_linkset.slmx'
       Artifact: 'D:\Work\Design_Specs\fuelsys.slx'
         Domain: 'linktype_rmi_simulink'
       Revision: 2
          Dirty: 0 

Set the link set description.

myLinkSet2.Description = "Link set for the fuel system"
myLinkSet2 = 

  LinkSet with properties:

    Description: 'Link set for the fuel system'
       Filename: 'C:\MATLAB\My_Files\fuelsys_linkset.slmx'
       Artifact: 'D:\Work\Design_Specs\fuelsys.slx'
         Domain: 'linktype_rmi_simulink'
       Revision: 2
          Dirty: 1 

Version History

Introduced in R2018a