It's all about the answers!

Ask a question

How to get Baselines of Components in a Stream with RTC Server Side API

Kurtuluş YILDIRIM (5559) | asked Nov 08 '18, 8:22 a.m.


I have a question. I am trying to develop an RTC follow-up action to create stream automatically. The action will look up the WI, create a stream and add components to that stream according to an attribute on WI. It will select baselines from another stream which consist only production baselines for components.
I managed to get production stream and its components but couldn’t find a way to get their baselines.
IWorkspaceSearchCriteria wsSearchCriteriaforProd = IWorkspaceSearchCriteria.FACTORY.newInstance();
                ItemQueryResult queryResultforStream=scmQuery.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE,null);
                if (queryResultforStream.getItemHandles().isEmpty()) {
                    for (int i = 0; i < queryResultforStream.getItemHandles().size(); i++) {
                        IWorkspaceHandle wshandle = (IWorkspaceHandle) queryResultforStream.getItemHandles().get(i);
                        IWorkspace ws = (IWorkspace) fItemService.fetchItem(wshandle, IRepositoryItemService.COMPLETE);
                        IComponentHandle[] componentHandles = scmService.getComponentsForWorkspace(wshandle, null);
Do you have any idea?

Accepted answer

permanent link
David Lafreniere (4.8k7) | answered Nov 08 '18, 9:32 a.m.
edited Nov 08 '18, 9:32 a.m.

You can retrieve the latest baseline (called the basis) of a component in a stream using:

Then from the returned object, you get the basis using: ComponentEntry.getBasis() which returns the IBaselineHandle.

Kurtuluş YILDIRIM selected this answer as the correct answer

Kurtuluş YILDIRIM commented Nov 08 '18, 5:42 p.m.

Thank you so much David. 

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.