DNG 6.0.2: Reading Module requirement using OSLC
Hi All ,
|
Accepted answer
Hello Naveen, When you are getting the result on QueryResult, get the data in RequirementCollection class rather than Requirement class. for eg., ClientResponse resp = Client.getResource(uri,OslcMediaType.APPLICATION_RDF_XML);
RequirementCollection module = resp.getEntity(RequirementCollection.class); Regards, Chintan Pania
Naveen Tyagi selected this answer as the correct answer
Comments
Naveen Tyagi
commented Feb 23 '17, 4:11 a.m.
Hi Chintan,
Naveen Tyagi
commented Feb 23 '17, 5:49 a.m.
I have tried this few times before and was able to get the all artifacts inside a folder: requirement, Collection[Requirements inside] module url but not requirements inside it. This time i tested same code again and collection code working fine for module as well. God knows what is happening in this world. Thanks :) |
One other answer
Try this snippet,
ClientResponse resp = Client.getResource(uri,
OslcMediaType.APPLICATION_RDF_XML);
RequirementCollection modulereq = resp
.getEntity(RequirementCollection.class);
for (URI reqUri : modulereq.getUses()) {
ClientResponse reqres = AuthClient.getResource(
reqUri.toString(),
OslcMediaType.APPLICATION_RDF_XML);
Requirement Req = reqres.getEntity(Requirement.class); // This will get all requirements under RequirementCollection/Module
}
|
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.