What is the API to get the info of sub component which is under newly added component while accepting?
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
Ralph Schoon (63.1k●3●36●46)
| 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.
Can you try calling IWorkspaceConnection.refresh and then checking if you see the right subcomponent information?
|
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.