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 (5558) | asked Nov 08 '18, 8:22 a.m.

Hi,

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();
                wsSearchCriteriaforProd.setKind(IWorkspaceSearchCriteria.STREAMS);
                wsSearchCriteriaforProd.setExactName(streamName);
                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.6k7) | answered Nov 08 '18, 9:32 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
edited Nov 08 '18, 9:32 a.m.

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

IScmService.getComponentEntry()
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

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

Thank you so much David. 

Your answer


Register or to post your answer.