It's all about the answers!

Ask a question

Link creation from DnG Artifact to another DNG Artifact using OSLC


Vaibhav S (6515) | asked May 14, 6:08 a.m.

 Hello,


I am trying to create a Satisfies link from 1 DNG Artifact to another DNG Artifact using below OSLC code:

String[] urls= result.getMembersUrls();
Link[] link = new Link[2];
for(int q=0; q<urls.length; q++) {
link[q] = new Link(new URI(urls[q]));
}
requirement.addSatisfies(satisfiesLink[0]); 

ClientResponse response = client.updateResource(urls[0], requirement, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML, etag);
if (response.getStatusCode() == 200 || response.getStatusCode() == 201) {
System.out.println("Link created from " + artifactid  + "  to  " + linkToArtifactId);

the code is executing but link is not reflecting in project Area.

Please let me know, if i am missing something here.

Thanks
Vaibhav


Comments
Ralph Schoon commented May 15, 12:50 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If this is supposed to be OSLC, where is the OSLC-Core-Version header?

I am not sure, but I would only expect one valid return code. Just because the System.out.println says something is created, does not mean it is. I would suggest to get the requirement and see what you get back and I would check what you get back from the PUT.

Be the first one to answer this question!


Register or to post your answer.