Main Content

slreq.generateTraceabilityDiagram

Create a traceability diagram

Since R2021b

    Description

    example

    slreq.generateTraceabilityDiagram(startingItem) creates a traceability diagram that originates from startingItem. If a traceability diagram is already open for the specified item, the diagram comes to the foreground.

    Note

    If you create a diagram from a link, the link source is the starting node. Similarly, if you create a diagram from a link set, the artifact specified by the Artifact is the starting node.

    Examples

    collapse all

    This example shows how to create a traceability diagram from a requirement object.

    Open the CruiseRequirementsExample project. Load the crs_req_func_spec requirement set.

    slreqCCProjectStart;
    slreq.load("crs_req_func_spec");

    Find the Enable Switch Detection requirement.

    req = slreq.find(Type="Requirement",Summary="Enable Switch Detection");

    Create a traceability diagram for the Enable Switch Detection requirement.

    slreq.generateTraceabilityDiagram(req)

    This example shows how to create a traceability diagram from a link object.

    Open the CruiseRequirementsExample 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. Then find the link with description #9: Enable Switch Detection.

    myLinkSet = slreq.find(Type="LinkSet",Name="crs_req");
    myLink = find(myLinkSet,Type="Link",Description="#9: Enable Switch Detection");

    Create a traceability diagram from the link.

    slreq.generateTraceabilityDiagram(myLink)

    This example shows how to create a traceability diagram from a requirement set.

    Open the CruiseRequirementsExample project. Load the crs_req_func_spec requirement set.

    slreqCCProjectStart;
    rs = slreq.load("crs_req_func_spec");

    Create a traceability diagram for the crs_req_func_spec requirement set by using the relative file path.

    relpath = fullfile("documents","crs_req_func_spec.slreqx")
    relpath = 
    "documents/crs_req_func_spec.slreqx"
    
    slreq.generateTraceabilityDiagram(relpath)

    This example shows how to create a traceability diagram from a link set.

    Open the CruiseRequirementsExample project. Load the crs_req link set.

    slreqCCProjectStart;
    ls = slreq.load("crs_req.slmx");

    Create a traceability diagram for the crs_req link set by using the relative file path.

    relpath = fullfile("documents","crs_req.slmx")
    relpath = 
    "documents/crs_req.slmx"
    
    slreq.generateTraceabilityDiagram(relpath)

    Close the link set and the Traceability Diagram window.

    slreq.clear;

    Input Arguments

    collapse all

    Starting item to create the traceability diagram from, specified as a:

    Version History

    Introduced in R2021b