Main Content

systemcomposer.updateLinksToReferenceRequirements

Update requirement links to model reference requirements

    Description

    example

    systemcomposer.updateLinksToReferenceRequirements(modelName,linkDomain,documentPathOrID)imports the external requirement document into金宝app®Requirements™as a reference requirement and updates the requirement links to point to the imported set. You can use thesystemcomposer.updateLinksToReferenceRequirementsfunction in System Composer™ to make the requirement links point to imported referenced requirements instead of external documents.

    Examples

    collapse all

    After importing requirement links from a file, update links to reference requirements for the model to make full use of the Simulink® Requirements™ functionality.

    model = systemcomposer.openModel('reqImportExample');

    Note:Importing or linking requirements may not work with a web-based Microsoft® Office file stored in SharePoint or OneDrive. Use a local copy of the file.

    Import Requirement Links from Word File

    Open the Microsoft® Word fileFunctional_Requirements.docxwith the requirements listed. Highlight the requirement to link.

    In the model, select the component to which to link the requirement. Right-click the component and selectRequirements > Link to Selection in Word.

    Export Model and Save to External File

    Export the model and save to an external file.

    exportedSet = systemcomposer.exportModel('reqImportExample'); SaveToExcel('exportedModel',exportedSet);

    Import Requirement Links from File and Import to Model

    Use the external file to import requirement links into another model.

    structModel = ImportModelFromExcel('exportedModel.xls','Components','Ports',...'Connections','PortInterfaces','RequirementLinks'); structModel.readTableFromExcel systemcomposer.importModel('reqNewExample',structModel.Components,...structModel.Ports,structModel.Connections,structModel.Interfaces,structModel.RequirementLinks);

    Update Links to Reference Requirements

    To integrate the requirement links to the model, update references within the model.

    systemcomposer.updateLinksToReferenceRequirements("reqNewExample","linktype_rmi_word","Functional_Requirements.docx")

    Open theRequirementsperspective from the bottom right corner of the model palette to view the requirements.

    Input Arguments

    collapse all

    Name of model, specified as a character vector or string.

    Data Types:char|string

    Link domain, specified as a character vector or string. SeeCustom Link Types(Simulink Requirements)for more information on identifying your link type or generating custom link types.

    Example:'linktype_rmi_word'

    Data Types:char|string

    Full document path, specified as a character vector or string.

    Example:'Functional_Requirements.docx'

    Data Types:char|string

    More About

    collapse all

    Definitions

    Term Definition Application More Information
    requirements Requirements are a collection of statements describing the desired behavior and characteristics of a system. Requirements ensure system design integrity and are achievable, verifiable, unambiguous, and consistent with each other. Each level of design should have appropriate requirements. 增强可追溯性的要求,系统的链接em, 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 Manager on an architecture model or through custom views. Assign test cases to requirements using the Test Manager for verification and validation. Link and Trace Requirements
    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 to edit and refine requirements in a requirement set. Requirement sets are stored in.slreqxfiles. You can create a new requirement set and author requirements usingSimulink Requirements, or import requirements from supported third-party tools. Manage Requirements
    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 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.slmxfiles.
    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. The Interface Editor is accessible in System Composer test harness models to enable behavior testing and implementation-independent interface testing.

    Introduced in R2020b