source
Class: slreq.Link
Package: slreq
Get link source
Syntax
Input Arguments
myLink
— Link object
slreq.Link
object
Link, specified as an slreq.Link
object.
Output Arguments
src
— Link source
struct
Link source, returned as a MATLAB® structure that contains these fields:
domain
artifact
id
Examples
Get a Link Source
This example shows how to get a link source from a link object.
Open the Requirements Definition for a Cruise Control Model project. Load the crs_req
requirement set, which also loads the crs_req
link set.
slreqCCProjectStart;
slreq.load("crs_req");
Find the crs_req
link set.
myLinkSet = slreq.find(Type="LinkSet",Name="crs_req");
Get the links from the link set.
myLinks = getLinks(myLinkSet)
myLinks=1×12 object
1x12 Link array with properties:
Type
Description
Keywords
Rationale
CreatedOn
CreatedBy
ModifiedOn
ModifiedBy
Revision
SID
Comments
Get the link source structure for one of the links.
src = source(myLinks(1))
src = struct with fields:
domain: 'linktype_rmi_slreq'
artifact: '/tmp/Bdoc22a_1891349_99509/bml.batserve.147285/MATLAB/Projects/examples/CruiseRequirementsExample5/documents/crs_req.slreqx'
id: '10'
Convert the link source structure to an object.
srcObj = slreq.structToObj(src)
srcObj = Reference with properties: Id: 'Enabling cruise control' CustomId: 'Enabling cruise control' Artifact: 'crs_req.docx' ArtifactId: '?Enabling cruise control' Domain: 'linktype_rmi_word' UpdatedOn: 02-Feb-2018 13:23:13 CreatedOn: NaT CreatedBy: '' ModifiedBy: '' IsLocked: 1 Summary: 'Enabling cruise control' Description: '<div class=WordSection1>...' Rationale: '' Keywords: {} Type: 'Functional' IndexEnabled: 1 IndexNumber: [] SID: 10 FileRevision: 1 ModifiedOn: 03-Aug-2017 17:34:56 Dirty: 0 Comments: [0x0 struct] Index: '3.1'
Cleanup
Clear the open requirement sets and link sets. Close the current project.
slreq.clear; slproject.closeCurrentProject();
Tips
You can use
slreq.structToObj
to convert the link source structure to an object.
Version History
See Also
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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)