It's all about the answers!

Ask a question

What is the API to get the info of sub component which is under newly added component while accepting?


Pushpa Gangadharaiah (131) | asked Aug 14 '20, 3:10 a.m.

There is a 'ComponentA', which is already loaded. the new component 'ComponentNew' is added and the existing component 'ComponentA' is added under ComponentNew as subcomponent. Is there a API to get info of subcomponent 'ComponentA' while accepting the change set.

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Aug 14 '20, 5:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can get the component hierarchy like this:

    IComponentHierarchyResult hierarchy = workspace.getComponentHierarchy(new ArrayList<icomponenthandle>());
</icomponenthandle>
    


Comments
Pushpa Gangadharaiah commented Aug 23 '20, 9:54 p.m.
I am fetching IWorkspaceSyncContext from IcomponentSyncContext, then getting the IWorkspaceConnection from IWorkspaceSyncContext.
Getting the IComponentHandle from IComponentSyncContext and adding it to list.      
      
      Map<UUID, Collection<IComponentHandle>> parentToChildrenMap = componentHierarchyResult.getParentToChildrenMap();
      Collection<IComponentHandle> children = parentToChildrenMap.get(componentSyncContext.getComponent().getItemId());

 


I get null for children.. where as there is a subcomponent.


David Lafreniere commented Sep 01 '20, 6:35 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Can you try calling IWorkspaceConnection.refresh and then checking if you see the right subcomponent information?

Your answer


Register or 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.