Main Content

oslc.core.CreationFactory

OSLC service provider creation factory

Since R2021a

    Description

    Use oslc.core.CreationFactory object functions to create resources in an Open Services for Lifecycle Collaboration (OSLC) service provider. After creating and configuring an oslc.Client, you can create a creation factory object for the service provider specified in the client object.

    Creation

    Create an oslc.core.CreationFactory object by using getCreationFactory.

    Properties

    expand all

    OSLC client associated with the creation factory, specified as an oslc.Client object.

    Creation factory resource URI, specified as a character vector.

    Resource URI for the RDF representation of the expected contents of the specified resource type, specified as a cell array.

    Example: {'https://localhost:9443/rm/types/_4zFVsRL5EeuLWbFL3e4vrw'}

    Creation factory object title, returned as a character array.

    Resource type to create in the OSLC service provider, specified as a cell array.

    Object Functions

    createCreate resource in OSLC service provider
    createChangeRequestCreate change request in OSLC service provider
    createRequirementCreate requirement in OSLC service provider
    createRequirementCollectionCreate requirement collection in OSLC service provider
    createTestCaseCreate test case in OSLC service provider
    createTestExecutionRecordCreate test execution record in OSLC service provider
    createTestPlanCreate test plan in OSLC service provider
    createTestResultCreate test result in OSLC service provider
    createTestScriptCreate test script in OSLC service provider

    Examples

    collapse all

    This example shows how to create all available creation factories for a previously configured OSLC client.

    After you have created and configured an OSLC client as described in Create and Configure an OSLC Client for the Requirements Management Domain, create all available creation factories for the client myClient.

    myCreationFactory = getCreationFactory(myClient)
    myCreationFactory = 
    
      1×8 CreationFactory array with properties:
    
        client
        creation
        resourceShape
        title
        resourceType

    Examine the creation factory resourceType to determine which creation factory you want to use.

    myCreationFactory(8).resourceType
    ans =
    
      1×1 cell array
    
        {'http://open-services.net/ns/rm#Requirement'}

    This example shows how to submit a creation request by using a creation factory with a previously 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 creation factory for the requirement resource type.

    myCreationFactory = getCreationFactory(myClient,'Requirement')
    myCreationFactory = 
    
      CreationFactory with properties:
    
               client: [1×1 oslc.Client]
             creation: 'https://localhost:9443/rm/requirementFactory?projectURL=https%3A...'
        resourceShape: {1×22 cell}
                title: 'Requirement Creation Factory'
         resourceType: {'http://open-services.net/ns/rm#Requirement'}

    Create a new requirement resource by using a creation factory and name the resource My New Requirement. Fetch the full resource properties for the requirement resource. Then commit the changes to the service provider.

    newReq = createRequirement(myCreationFactory,'My New Requirement');
    status = fetch(newReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK

    status = commit(newReq,myClient)
    status = 
    
      StatusCode enumeration
    
        OK

    View the resource that you created in the service provider.

    show(newReq)

    Version History

    Introduced in R2021a