Main Content

queryRequirements

Query OSLC service provider for requirements

Since R2021a

    Description

    reqs = queryRequirements(myQueryCapability) returns the available requirement resources in the Open Services for Lifecycle Collaboration (OSLC) service provider that is associated with the query capability myQueryCapability.

    example

    Examples

    collapse all

    This example shows how to submit a query request with a configured OSLC client.

    After you have created and configured an OSLC client myClient as described in Create and Configure an OSLC Client for the Requirements Management Domain, create a query capability for the requirement resource type.

    myQueryCapability = getQueryService(myClient,'Requirement')
    myQueryCapability = 
    
      QueryCapability with properties:
    
        queryParameter: ''
                client: [1×1 oslc.Client]
             queryBase: 'https://localhost:9443/rm/views?oslc.query=true&projectURL=http...'
         resourceShape: {0×1 cell}
                 title: 'Query Capability'
          resourceType: {1×2 cell}

    Submit a query request to the service provider for the available requirement resources.

    reqs = queryRequirements(myQueryCapability)
    reqs = 
    
      1×30 Requirement array with properties:
    
        ResourceUrl
        Dirty
        IsFetched
        Title
        Identifier

    Assign the first returned requirement resource to the variable myReq, then fetch the full resource properties for myReq. Examine the Title property.

    myReq = reqs(1);
    status = fetch(myReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK
    title = myReq.Title
    title =
    
        'Requirement 1'
    

    Input Arguments

    collapse all

    OSLC resource query capability, specified as an oslc.core.QueryCapability object.

    Output Arguments

    collapse all

    OSLC requirement resource, returned as an oslc.rm.Requirement object.

    Version History

    Introduced in R2021a