Main Content

oslc.rm.Requirement

Requirement resource for OSLC requirements management domain

    Description

    The oslc.rm.Requirement object represents requirement resources in the requirements management domain of the Open Services for Lifecycle Collaboration (OSLC) service provider. After creating and configuring oslc.Client and oslc.core.QueryCapability objects, query the service provider for available requirement resources by using the queryRequirements function.

    Creation

    Create an oslc.rm.Requirement object by using the createRequirement function.

    Properties

    expand all

    Navigation URL for the requirement resource, specified as a character array.

    Indicator for uncommitted changes to the requirement resource, specified as a logical 1or 0 where:

    • 1 indicates the requirement resource has uncommitted changes.

    • 0 indicates the requirement resource has no uncommitted changes.

    Data Types: logical

    requirement resource fetch status, specified as a logical 1 or 0 where:

    • 1 indicates the requirement resource is fetched.

    • 0 indicates the requirement resource is not fetched.

    Data Types: logical

    Requirement title, specified as a character array.

    OSLC requirement resource identifier, specified as a character array.

    Object Functions

    addLinkAdd link to local OSLC requirement resource object
    addResourcePropertyAdd resource property to local OSLC resource object
    addTextPropertyAdd text property to local OSLC resource object
    commitSend local changes to OSLC service provider
    fetchRetrieve full resource data from OSLC service provider
    getLinksGet locally stored traceability links from OSLC requirement resource object
    getPropertyGet local contents of text property from OSLC resource object
    getRDFGet resource RDF/XML data from OSLC resource object
    getResourcePropertyGet local contents of resource property from OSLC resource object
    getSLRequirementsGet imported referenced requirement associated with OSLC requirement resource object
    removeRemove resource from OSLC service provider
    removeLinkRemove link from local OSLC requirement resource object
    removeResourcePropertyRemove resource property from local OSLC resource object
    setPropertySet local contents of text property for OSLC resource object
    setRDFSet RDF content for local OSLC resource object
    setResourceUrlSet resource URL for local OSLC resource object
    showView OSLC resource in system browser

    Examples

    collapse all

    This example shows how to submit a query request for requirement resources with a configured OSLC client, edit an existing requirement resource, and commit the changes to the service provider.

    After you have created and configured the 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');

    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 a requirement resource to the variable myReq. Retrieve the full resource data from the service provider for the requirement resource. Examine the Title property.

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

    Edit the requirement title and commit the change to the service provider.

    myReq.Title = 'My New Requirement Title';
    status = commit(myReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK

    Open the requirement resource in the system browser by using the show function.

    show(myReq)

    This example shows how to submit a creation request for a new requirement resource with a configured OSLC client.

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

    myCreationFactory = getCreationFactory(myClient,'Requirement');

    Use the creation factory to create a new requirement resource with the title My New Requirement. Retrieve the full resource data from the service provider for the requirement resource and inspect the resource.

    newReq = createRequirement(myCreationFactory,'My New Requirement');
    fetch(newReq,myClient);
    newReq
    newReq = 
    
      Requirement with properties:
    
        ResourceUrl: 'https://localhost:9443/rm/resources/_72lxMWJREeup0...'
              Dirty: 0
          IsFetched: 1
              Title: 'My New Requirement'
         Identifier: '1806'

    Open the requirement resource in the system browser by using the show function.

    show(newReq)
    Introduced in R2021a