Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

DNG 6.0.2: Reading Module requirement using OSLC

 Hi All ,
I tried doing some operations[read/delete/update/create artifacts in module] on DNG module using OSLC/Lyo but didn't make any progress. Is  it really not possible or am i missing something ?


0 votes


Accepted answer

Permanent link

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

0 votes

Comments

Hi Chintan,
Thanks for you response!!!
For collection i have already implemented all the operations but  but not able to do same for Module like list of requirements in a module. 

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

Permanent link

 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
}


0 votes

Comments

 I have implemented the same but i think i was missing something. Thanks 

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Feb 23 '17, 2:01 a.m.

Question was seen: 2,776 times

Last updated: Mar 02 '17, 7:08 a.m.

Confirmation Cancel Confirm