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 |
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 Hi I am trying to create links in artifact trough OSLC api, but seems no luck, Unable to see satisfies link in artifact though I am getting response as 200 for update operation,
Have you checked the instance shape of the artifact as I suggested? GET an RDF+XML presentation of the artifact first, and take note of the <oslc:instanceShape> attribute. Then GET the instance shape, and you should see something like this <oslc:Property> <oslc:name>_05YjMYPsEeSfUbpncKGSsw</oslc:name> <oslc:propertyDefinition rdf:resource="https://clm502/rm/types/_05YjMYPsEeSfUbpncKGSsw" /> <oslc:representation rdf:resource="http://open-services.net/ns/core#Reference" /> <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource" /> <dc:description rdf:parseType="Literal" /> <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-many" /> <dc:title rdf:parseType="Literal">Satisfaction</dc:title> </oslc:Property> |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Hi nitesh,