It's all about the answers!

Ask a question

How can I create in DNG via API a new change set?

Antje Rößle-Tuchel (151) | asked Nov 13, 7:10 a.m.

I want to create a new change set in DNG via a HTTP Request:

My last trial looks like that: 


Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Content-type: application/rdf+xml
Configuration-Context: [stream-URI / change-set-URI: I've tried both, I can see no difference in the response]

<?xml version="1.0" encoding="UTF-8"?>
    <j.0:Configuration rdf:about="">
      <dcterms:title rdf:parseType="Literal">Change Set created from API</dcterms:title>
      <j.0:stream rdf:resource="[streamUri]"/>
      <j.0:component rdf:resource="[componentUri]"/>
      <rdf:type rdf:resource=""/>

As response I get "200 OK" but not a "201 Created" and no task tracker or changeSetUri.

What is missing in my request?

Accepted answer

permanent link
Ian Barnard (1.8k613) | answered Nov 13, 8:01 a.m.
edited Nov 13, 8:23 a.m.

You need to post to the changesets URI of the stream.

Follow discovery like this - i.e. DO NOT construct any URL other than /rm/rootservices

Follow that flow, and below "To details of the config" with this example RDF for the stream:
  <oslc_config:Configuration rdf:about="">
    <oslc_config:baselines rdf:resource=""/>
    <oslc_config:previousBaseline rdf:resource=""/>
    <oslc_config:acceptedBy rdf:resource=""/>
    <oslc_config:component rdf:resource=""/>
    <dcterms:title rdf:parseType="Literal">rm_gc_p1 Initial Stream</dcterms:title>
    <oslc:serviceProvider rdf:resource=""/>
    <dcterms:created rdf:datatype=""
    <rdf:type rdf:resource=""/>
    <j.0:changesets rdf:resource=""/>
    <oslc_config:selections rdf:resource=""/>
    <acc:accessContext rdf:resource=""/>
    <process:projectArea rdf:resource=""/>
    <dcterms:creator rdf:resource=""/>
You see the changesets URL for this stream in     <j.0:changesets rdf:resource=""/>

POST to this with headers:
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Content-type: application/rdf+xml
Configuration-Context: stream-URI

Minimal XML is like this:

      <oslc_config:Configuration rdf:about="">
        <dcterms:title rdf:parseType="Literal">Title of the Changeset</dcterms:title>
        <dcterms:description rdf:parseType="Literal">Some Description of Changeset</dcterms:description>      
        <oslc_config:component rdf:resource=""/>

NOTE the "something" rdf:about URI in tag oslc_config:component has to be present as a dummy URL, all URLs need adapting to your SERVER:PORT, the oslc_config:component must be your component URL

Success response is 202 with header Location pointing at the task tracker.

Antje Rößle-Tuchel selected this answer as the correct answer

Antje Rößle-Tuchel commented Nov 13, 8:17 a.m.

 Thank you very much! This work. I get a 202 accepted and a task tracker as respond.  

Antje Rößle-Tuchel commented Dec 06, 7:04 a.m.

How can I get resources in the change set? 

Background: I need to deliver one change set several times. So I need to derive a change set from another to be able to deliver it via delivery sessions. Therefore I think I need to get a wasDerivedFrom link to the orginal change set and additionally the changed resources "copied" from the original change set in the new one created. Is this possible and how?

Ian Barnard commented Dec 06, 7:12 a.m.
Technically speaking a changeset configuration references all the resources in the stream, i.e. not just changed resources. And once delivered the changeset doesn't exist any more, or at least it isn't visible if you use the APIs to find changesets.

I don't know the answer to your question but I've never heard of the need to derive a new changes set to deliver again. Maybe using the changeset URL which you've already got you can use that (again) as the source configuration to deliver to a different target stream (in the same component, of course) than the stream the changeset was created in/from? If that doesn't work then what you're asking for probably isn't possible today.

Your answer

Register or to post your answer.