Contenido principal

slreq.createExternalLink

R2026b

Create links to external requirements

Since R2026b

    Description

    myLink = slreq.createExternalLink(src,resource) creates a link from the source artifact, src, to the external requirement resource, resource.

    example

    myLink = slreq.createExternalLink(src,resource,label) creates a link to an external requirement resource and assigns it the label, label.

    example

    myLink = slreq.createExternalLink(src,resource,label,id) creates a link to the external requirement with the ID, id.

    example

    myLink = slreq.createExternalLink(src,resource,label,id,docInterfaceName) creates a link to a resource in a third-party tool using the custom document interface specified by docInterfaceName.

    Tip

    To create links to requirements in IBM® DOORS® Next, set the docInterfaceName argument to "dng".

    example

    Examples

    collapse all

    Suppose that you have a function called myAdd.m. Create a text range that refers to the function definition on line 1.

    src = slreq.createTextRange("myAdd.m",[1 1]);

    Create a link from the text range to a web URL.

    myLink = slreq.createExternalLink(src,"https://example.com/specs/controller-spec");

    Navigate to the link destination.

    slreq.show(myLink.destination);

    Create a labeled link that links to the external requirement requirements.txt and assign it the label "System Requirements".

    myLink = slreq.createExternalLink(src,"requirements.txt","System Requirements");

    Create a link to the bookmark with the name "REQ_001" in the Microsoft® Word document requirement-spec.docx. Assign it the label "Maximum pressure"

    myLink = slreq.createExternalLink(src,"requirement-spec.docx","Maximum pressure","@REQ_001");

    Create a link to a requirement with the name "REQ-001" in a Polarion™ by using a custom document interface.

    myLink = slreq.createExternalLink(src,"http://my.polarion.server/projects/myproject","REQ-001","REQ-001","custom_polarion");

    Create a link to a requirement that has the ID 528 in a module called Safety Reqs in an IBM DOORS Next project called MyDNGProject.

    Create a link to a specific requirement by specifying the requirement ID.

    myLink = slreq.createExternalLink(src,"MyDNGProject","Safety Reqs","528","dng");

    Create a link directly to the project by leaving the ID empty.

    myLink = slreq.createExternalLink(src,"MyDNGProject","DNG Project Link","","dng");

    Note

    If you create a link to IBM DOORS Next and the session is not already configured, Requirements Toolbox™ prompts you to enter the server details and login credentials. For more information, see slreq.dngConfigure.

    Input Arguments

    collapse all

    Link source item, specified as a:

    Additionally, you can specify these Simulink Fault Analyzer™ objects:

    External requirement resource, specified as a string scalar or character vector. The accepted value depends on the resource type.

    Resource TypeAccepted ValueExample

    • Microsoft Word file

    • Microsoft Excel® file

    • PDF file

    • TXT file

    • HTML file

    File path"myWordDoc.docx"
    Web URLURL"https://example.com/specs/controller-spec"

    IBM DOORS

    Module ID"000001a0"

    IBM DOORS Next

    Project name

    "MyDNGProject"
    Custom document interfaceName of the registered document interface. Define the custom document interface using the syntax in Define Custom Document Interface for Direct Linking to Requirements."myCustomDocInterface"

    Example: slreq.createExternalLink(src,"myWordDoc.docx")

    Link label, specified as a string scalar or character vector. This text is stored as the Description property and also appears in the Requirements Editor.

    Example: slreq.createExternalLink(src,"myWordDoc.docx","@bookmark1")

    Requirement ID, specified as a string scalar or character vector, that specifies a specific location in the resource. The format depends on the resource type.

    Resource TypeDelimiterDescription
    Microsoft Word@Bookmark ID. For example, "@REQ_001".
    ?First instance of text. For example: "?numeric inputs".
    #Page number. For example, "#2".
    Microsoft Excel$

    Cell, row, column, or range. For example:

    • "$A3"

    • "$3:3"

    • "$A:A"

    • "$A3:B3"

    @Named range. For example, "@REQ_001".
    ?First instance of text. For example, "?REQ-002".
    HTML file@Anchor ID. For example, "@REQ-002".

    IBM DOORS

    #Object identifier. For example, "#42".

    IBM DOORS Next

    N/ANumeric requirement identifier. For example, "528".
    Text file>Line number. For example, ">2".
    ?First instance of text. For example, "?REQ-002".
    PDF#Page number. For example, "#2".
    Web URL@HTML element ID. For example, "@section1".
    Custom document interfaceN/ARequirement ID from the third-party tool. For more information, see Define Custom Document Interface for Direct Linking to Requirements.

    Example: slreq.createExternalLink(src,"myWordDoc.docx","@bookmark1","@REQ_001")

    Document interface name, specified as a string scalar or character vector. If you specify this argument as "dng", the function creates a link to IBM DOORS Next. Otherwise, the function creates a link to the specified third party tool. For more information about custom document interfaces, see Define Custom Document Interface for Direct Linking to Requirements.

    Example: slreq.createExternalLink(src,"http://my.polarion.server/projects/myproject","REQ-001","REQ-001","custom_polarion")

    Output Arguments

    collapse all

    Link, returned as an slreq.Link object.

    Tips

    • To create links to destinations in MATLAB® or Simulink, use slreq.createLink.

    • To create a link to a URL with an anchor, pass the entire URL as the resource input.

    Version History

    Introduced in R2026b