systemcomposer.updateLinksToReferenceRequirements
Description
systemcomposer.updateLinksToReferenceRequirements(
imports the external requirement document into Requirements Toolbox™ as a reference requirement and redirects the requirement links to point to the
imported set.modelName
,linkDomain
,documentPathOrID
)
You can use the systemcomposer.updateLinksToReferenceRequirements
function in System Composer™ to make the requirement links point to imported referenced requirements instead of external documents.
Examples
Redirect Reference Requirement Links from Imported File
After importing requirement links from a file, redirect links to reference requirements in the model. When you convert the links to reference requirement links, the links are contained in the model in an SLREQX file to make full use of Requirements Toolbox™ functionality.
Import Requirement Links from Word File
Before running the code, follow these steps to prepare your workspace.
Note: Importing or linking requirements from an imported file is only supported on Windows®. A web-based Microsoft® Office file stored in SharePoint® or OneDrive does not work. Save this file and supporting files in a local folder to continue.
1. Open the Microsoft Word file Functional_Requirements.docx
with the requirements listed. Highlight the requirement to link. For example, highlight these lines.
1.1.2 Flight Computer ID: 25 Description: Aircraft shall provide a flight computer to autonomously conduct safe flight operations from launch to recovery
2. Open the reqImportExample.slx
model.
model = systemcomposer.openModel("reqImportExample");
3. In the model, select the FlightComputer
component to which to link the requirement. Right-click the FlightComputer
component and select Requirements > Link to Selection in Word. Keep the Word file Functional_Requirements.docx
open for the next steps.
Before requirement links are integrated within the model, the links depend on the source document, the Word file Functional_Requirements.docx
. To view the requirement links, open the Requirements Perspective from the bottom-right corner of the reqImportExample.slx
model palette.
Redirect Links to Reference Requirements
Follow these steps to redirect requirement links to integrate with and reference from within the model.
1. Export the reqImportExample.slx
model and save to an external file: exportedModel.xls
exportedSet = systemcomposer.exportModel("reqImportExample"); SaveToExcel("exportedModel",exportedSet);
2. Use the external file exportedModel.xls
to import requirement links into another model: reqNewExample.slx
structModel = ImportModelFromExcel("exportedModel.xls","Components","Ports", ... "Connections","PortInterfaces","RequirementLinks"); structModel.readTableFromExcel systemcomposer.importModel("reqNewExample",structModel.Components, ... structModel.Ports,structModel.Connections,structModel.Interfaces,structModel.RequirementLinks);
3. To integrate the requirement links to the new model reqNewExample.slx
, redirect references within the model.
systemcomposer.updateLinksToReferenceRequirements("reqNewExample",... "linktype_rmi_word","Functional_Requirements.docx")
4. Open the Requirements Perspective from the bottom right corner of the model palette to view the new Flight Computer
requirement on the FlightComputer
component by setting View to Requirements.
This requirement is saved in a requirement set Functional_Requirements.slreqx
and used directly in the requirement link. Change the View to Links to view the requirement link.
Input Arguments
modelName
— Name of model
character vector | string
Name of model, specified as a character vector or string.
Example: "exMobileRobot"
Data Types: char
| string
linkDomain
— Link domain
character vector | string
Link domain, specified as a character vector or string. See Link Types (Requirements Toolbox) for more information on identifying your link type or generating custom link types.
Example: "linktype_rmi_word"
Data Types: char
| string
documentPathOrID
— Full document path
character vector | string
Full document path, specified as a character vector or string.
Example: "Functional_Requirements.docx"
Data Types: char
| string
More About
Definitions
Term | Definition | Application | More Information |
---|---|---|---|
requirements | Requirements are a collection of statements describing the desired behavior and characteristics of a system. Requirements help ensure system design integrity and should be achievable, verifiable, unambiguous, and consistent with each other. Each level of design should have appropriate requirements. | To enhance traceability of requirements, link system, functional, customer, performance, or design requirements to components and ports. Link requirements to each other to represent derived or allocated requirements. Manage requirements from the Requirements Perspective on an architecture model or through custom views. Assign test cases to requirements using the Simulink Test Manager (Simulink Test) for verification and validation. | |
requirement set | A requirement set is a collection of requirements. You can structure the requirements hierarchically and link them to components or ports. | Use the Requirements Editor (Requirements Toolbox) to edit and refine requirements in a requirement set. Requirement sets are stored in SLREQX files. You can create a new requirement set and author requirements using Requirements Toolbox, or import requirements from supported third-party tools. | |
requirement link | A link is an object that relates two model-based design elements. A requirement link is a link where the destination is a requirement. You can link requirements to components or ports. | View links by using the Requirements Perspective in System Composer. Select a requirement in the Requirements Browser to highlight the component or the port to which the requirement is assigned. Links are stored externally as SLMX files. | |
test harness | A test harness is a model that isolates the component under test with inputs, outputs, and verification blocks configured for testing scenarios. You can create a test harness for a model component or for a full model. A test harness gives you a separate testing environment for a model or a model component. | Create a test harness for a System Composer component to validate simulation results and verify design. To edit the interfaces while you are testing the behavior of a component in a test harness, use the Interface Editor. |
|
Version History
Introduced in R2020b
See Also
Topics
- Link Directly to Requirements in Third-Party Applications (Requirements Toolbox)
- Allocate and Trace Requirements from Design to Verification
- Establish Traceability Between Architectures and Requirements
- Import and Export Architecture Models
- Migrating Requirements Management Interface Data to Requirements Toolbox (Requirements Toolbox)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)