Requirement Links and Link Types
Requirements Traceability Links
When you want to navigate from a Simulink® model or from a region of MATLAB® code to a location inside a requirements document, you can add requirements traceability links to the model or code.
Requirements traceability links have the following attributes:
A description of up to 255 characters.
A requirements document path name, such as a Microsoft® Word file or a module in an IBM® DOORS® database. (The RMI supports several built-in document formats. You can also register custom types of requirements documents. See Supported Requirements Document Types.)
A designated location inside the requirements document, such as:
Keywords that you define
Supported Model Objects for Requirements Linking
You can associate requirements links between the following types of Simulink model objects:
Simulink block diagrams and subsystems
Simulink blocks and annotations
Simulink data dictionary entries
Signal Builder signal groups
Stateflow® charts, subcharts, states, transitions, and boxes
Lines of MATLAB code
Simulink Test™ Manager test cases
Links and Link Types
Requirements links are the data structures, managed by Simulink, that identify a specific location within a document. You get and set
the links on a block using the
Links and link types work together to perform navigation and manage requirements.
id fields of a link uniquely
identify the linked item in the external document. The RMI passes both of these
values to the navigation command when you navigate a link from the model.
Link Type Properties
Link type properties define how links are created, identified, navigated to, and stored within the requirement management tool. The following table describes each of these properties.
The name of the function that creates the link type. The RMI stores this name in the Simulink model.
A string to identify this link type. In the Outgoing Links Editor, this string appears on the Document type drop-down list for a Simulink or Stateflow object.
A Boolean property that indicates if the linked documents are files within the computer file system. If a document is a file:
An array of file extensions. Use these file extensions as filter options in the Outgoing Links Editor when you click Browse. The file extensions infer the link type based on the document name. If you registered more than one link type for the same file extension, the link type that you registered takes first priority.
A string containing the list of supported navigation
delimiters. The first character in the ID of a requirement
specifies the type of identifier. For example, an identifier can
refer to a specific page number (
The MATLAB callback invoked when you click a link. The function has two input arguments: the document field and the ID field of the link:
feval(LinkType.NavigateFcn, Link.document, Link.id)
The MATLAB callback invoked when you click the Document Index tab in the Outgoing Links Editor. This function has a single input argument that contains the full path of the resolved function or, if the link type is not a file, the Document field contents.
The function returns three outputs:
The MATLAB callback invoked when you click Browse in the Outgoing Links Editor. You do not need this function when the link type is a file. The function takes no input arguments and returns a single output argument that identifies the selected document.
The MATLAB callback that constructs a path name to the requirement. This function uses the document path or URL to create a specific requirement URL. The requirement URL is based on a location identifier specified in the third input argument. The input arguments are:
This function returns a single output argument specified as a character vector. Use this argument when navigating to the requirement from the generated report.
The MATLAB callback invoked when you run a requirements consistency check. The function takes one input argument—the fully qualified name for the requirements document. It returns true if the document can be located; it returns false if the document cannot be found or the document name is invalid.
The MATLAB callback invoked when you run a requirements consistency check. This function takes two input arguments:
The MATLAB callback invoked when you run a requirements consistency check. This function has three input arguments:
The MATLAB callback invoked when you generate the requirements report with the Include details from linked documents option. This function returns detailed content associated with the requirement and has three input arguments:
The MATLAB callback invoked when you use the selection-based linking menu option for this document type. This function has two input arguments:
The MATLAB callback invoked when you link external test cases with the requirements to the custom link type file. It is used in the custom link type file and fetches external results to integrate with verification statuses.
This function has one input argument:
The function returns a single output argument,
Outgoing Links Editor
Manage Requirements Traceability Links Using the Outgoing Links Editor
You can create, edit, and delete requirements traceability links using the Outgoing Links Editor. To open the Outgoing Links Editor:
in the Simulink Editor, right-click on a model object that has a requirements traceability link. From the context menu, select Requirements > Open Outgoing Links dialog.
in the MATLAB Editor, right-click inside a region of code that has a requirements traceability link. From the context menu, select Requirements > Open Outgoing Links dialog.
The Outgoing Links Editor opens, as shown below.
In the Outgoing Links Editor, you can:
Create requirements links from one or more Simulink model objects or MATLAB code lines.
Customize information about requirements links, including specifying user keywords to filter requirements highlighting and reporting.
Delete existing requirements links.
Modify the stored order of requirements to control the order of labels in context menus for linked objects.
On the Requirements tab, you specify detailed information about the link, including:
Description of the requirement (up to 255 words). If you create a link using the document index, unless a description already exists, the name of the index location becomes the description for the link.
Path name to the requirements document.
Document type (Microsoft Word, Microsoft Excel®, IBM DOORS, MuPAD®, HTML, text file, etc.).
Location of the requirement (search text, named location, or page or item number).
User-specified keyword or keyword.
Document Index Tab
The Document Index tab is available only if you have specified a file in the Document field on the Requirements tab that supports indexing. On the Document Index tab, the RMI generates a list of locations in the specified requirements document for the following types of requirements documents:
The RMI cannot create document indexes for PDF files.
From the document index, select the desired requirement from the document index and click OK. Unless a description already exists, the name of the index location becomes the description for the link.
If you make any changes to your requirements document, to load any newly created locations into the document index, you must click Refresh. During a MATLAB session, the RMI does not reload the document index unless you click the Refresh button.