Main Content

destination

Class: slreq.Link
Package: slreq

Get link destination

Description

example

dest = destination(myLink) returns the link destination of the link myLink.

Input Arguments

expand all

Link, specified as an slreq.Link object.

Output Arguments

expand all

Link destination, returned as a MATLAB® structure that contains these fields:

  • domain

  • artifact

  • id

  • summary

  • reqSet

  • sid

Examples

expand all

This example shows how to get a link destination 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 destination structure for one of the links.

dest = destination(myLinks(1))
dest = struct with fields:
      domain: 'linktype_rmi_slreq'
    artifact: '/tmp/Bdoc21b_1757077_61781/bml.batserve.009269/MATLAB/Projects/examples/CruiseRequirementsExample4/documents/crs_req_func_spec.slreqx'
          id: '#9'
     summary: 'Enable Switch Detection'
      reqSet: 'crs_req_func_spec.slreqx'
         sid: 9

Convert the link destination structure to an object.

destObj = slreq.structToObj(dest)
destObj = 
  Requirement with properties:

            Type: 'Functional'
              Id: '#9'
         Summary: 'Enable Switch Detection'
     Description: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">...'
        Keywords: {}
       Rationale: ''
       CreatedOn: 27-Feb-2017 10:15:38
       CreatedBy: 'itoy'
      ModifiedBy: 'asriram'
             SID: 9
    FileRevision: 55
      ModifiedOn: 03-Aug-2017 14:39:35
           Dirty: 0
        Comments: [0x0 struct]
           Index: '1.6'

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 destination structure to an object.

Introduced in R2018a