How to add "SatisfiedBy/satisfies" link in DNG workitem through OSLC API?
Hi All,
I am working on task where I have to update DNG artifact with link("SatisfiedBy/satisfies"). I am using OSLG4j(OSLC client) for developing my stand alone application. I am able to add link of type "SpecifiedBy/Specifies" in DNG artifact through my code, but not able to add "SatisfiedBy/satisfies" link.
Sample code
Requirement req = response.getEntity(Requirement.class);
String etag = response.getHeaders().getFirst(OSLCConstants.ETAG);
ClientResponse updateResponse = null;
req.addSatisfiedBy(new Link(new URI(artifact.getKey()), artifact.getValue()));
updateResponse = client.updateResource(resultsUrl, req, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML, etag);
if(updateResponse.getStatusCode() ==HttpStatus.SC_OK) {
System.out.println("Requirement updated successfully with requirement : " + artifact.getValue());
} else {
System.out.println("Issue while updating requirement..............." + artifact.getValue());
}
When I run this code I am getting response 200 but unable to see link in Doors artifact. Is there any linitation on adding by OSLC rest api?
Could you please let me know how to achieve same?
Thank you in advance
I am working on task where I have to update DNG artifact with link("SatisfiedBy/satisfies"). I am using OSLG4j(OSLC client) for developing my stand alone application. I am able to add link of type "SpecifiedBy/Specifies" in DNG artifact through my code, but not able to add "SatisfiedBy/satisfies" link.
Sample code
Requirement req = response.getEntity(Requirement.class);
String etag = response.getHeaders().getFirst(OSLCConstants.ETAG);
ClientResponse updateResponse = null;
req.addSatisfiedBy(new Link(new URI(artifact.getKey()), artifact.getValue()));
updateResponse = client.updateResource(resultsUrl, req, OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_RDF_XML, etag);
if(updateResponse.getStatusCode() ==HttpStatus.SC_OK) {
System.out.println("Requirement updated successfully with requirement : " + artifact.getValue());
} else {
System.out.println("Issue while updating requirement..............." + artifact.getValue());
}
When I run this code I am getting response 200 but unable to see link in Doors artifact. Is there any linitation on adding by OSLC rest api?
Could you please let me know how to achieve same?
Thank you in advance
One answer
No such problem in my RDNG 5.0.2 environment. It should be quite simple as to add a <rm_property> attribute to the artifact presentation and update it with a PUT operation. I suggest you double check the instance shape of the artifact and make sure you are using the correct UUID for the Satisfaction link type.
Comments
Vaibhav S
May 17 '21, 1:38 p.m.