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

List parents and children relationship

Hi fellows,

I am building an app that lists assets and their relationships (belongs to,
has).

Here is a part of code:

RAMAssetQueryBuilder query;

query.addQueryField(query.QUERY_FIELD_NAME, "*");
query.addQueryField(query.QUERY_FIELD_VERSION, "*");


RAMCommunity com = session.getCommunity("Services");
query.addSearchFilter(com);

SearchResult result = session.getAssets(query);
RAMAssetSearchResult[] serviceAssets = (RAMAssetSearchResult)result.getAssetSearchResults();


This code will return me a list of assets.
But now I need to get asset relationships informations (parents, children). How to do this? I know there is a getRelationships() method for RAMAsset object, but the relationship returned do not give to me information about the related assets. I also know there is a getParentAsset() method for RAMRelationship object, but I cannot cast Relationship to RAMRelationship. How to get parents and children informations?



Thanks!!!

0 votes



One answer

Permanent link
First

query.addQueryField(query.QUERY_FIELD_NAME, "*");
query.addQueryField(query.QUERY_FIELD_VERSION, "*");

is not adding anything you can just use the community filter in your search and get the same result.

Second

You can cast the Relationship you get back from getRelationships() to a RAMRelationship.

0 votes

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

Question asked: Jun 10 '10, 7:32 a.m.

Question was seen: 6,041 times

Last updated: Jun 10 '10, 7:32 a.m.

Confirmation Cancel Confirm