Main Content

getCreationFactory

Get OSLC creation service object

    Description

    example

    myCreationFactory = getCreationFactory(myClient) returns all available creation factories for the OSLC client myClient.

    example

    myCreationFactory = getCreationFactory(myClient,resourceType) returns a creation factory for the resource type specified by resourceType for the OSLC client myClient.

    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)

    Input Arguments

    collapse all

    OSLC client, specified as an oslc.Client object.

    OSLC resource type, specified as character array with one of these values:

    • 'ChangeRequest'

    • 'TestCase'

    • 'TestExecutionRecord'

    • 'TestPlan'

    • 'TestResult'

    • 'TestScript'

    • 'Requirement'

    • 'RequirementCollection'

    The specified resource type must match the domain for the configured oslc.Client object.

    Output Arguments

    collapse all

    OSLC resource creation factory, specified as an oslc.core.CreationFactory object.

    Version History

    Introduced in R2021a