Contenu principal

digitalthread.uri.requirements.toObject

R2026b

Convert digital thread URI to Requirements Toolbox object

Since R2026b

    Description

    reqObj = digitalthread.uri.requirements.toObject(dtContext,reqURI) returns the Requirements Toolbox™ object identified by the digital thread URI and loads the associated requirement set or link set file.

    A digital thread URI is a stable identifier for an artifact, such as a requirement set file, or an artifact within that file, such as an individual requirement. The digital thread uses these URIs as a consistent way to refer to artifacts across tools and inside metric results.

    Use this function to retrieve the Requirements Toolbox object identified by the digital thread URI. You can then work directly with that object.

    You might already have a digital thread URI of interest from your metric results. If not, you can get the digital thread URI from a specific Requirements Toolbox object by using the other functions in the digitalthread.uri.requirements namespace, such as digitalthread.uri.requirements.fromObject.

    reqObj = digitalthread.uri.requirements.toObject(___,Load=false) returns the Requirements Toolbox object without loading the requirement set or link set file.

    example

    Examples

    collapse all

    Suppose you already have a digital thread URI for a Requirements Toolbox object that appears in your metric results. You can get the associated object by using the digitalthread.uri.requirements.toObject function.

    For example, suppose your metric results show a digital thread URI mwdigitalthread://myProject/myReqs.slreqx and you save that URI to a variable.

    myURI = "mwdigitalthread://myProject/myReqs.slreqx";

    Create a storage map for the current project.

    dtContext = digitalthread.StorageMap.forProject();

    Find the Requirements Toolbox object associated with that digital thread URI.

    myObj = digitalthread.uri.requirements.toObject(dtContext,myURI)
    myObj = 
    
      ReqSet with properties:
    
                 Description: ''
                        Name: 'myReqs'
                    Filename: 'C:\MATLAB\myProject\myReqs.slreqx'
                        ...

    You can use the object properties and Requirements Toolbox functions, such as slreq.open (Requirements Toolbox), to work with the object.

    Input Arguments

    collapse all

    Digital thread context, specified as a digitalthread.StorageMap object.

    The digital thread context defines the set of design artifacts and elements that the digital thread can identify with URIs. The context determines which artifacts the digital thread can reference, trace, and associate with metric results.

    To get the digital thread context for a project, use digitalthread.StorageMap.forProject.

    Example: digitalthread.StorageMap.forProject()

    Digital thread URI for Requirements Toolbox object, specified as a string scalar.

    You can get digital thread URIs from metric results, functions in the digitalthread.uri.requirements namespace, and other functions in the digitalthread.uri namespace.

    Example: "mwdigitalthread://myProject/myReqs.slreqx#addr=123-abc"

    Data Types: string

    Output Arguments

    collapse all

    Requirements Toolbox object, returned as either a:

    Version History

    Introduced in R2026b