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

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

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?

0 votes


Accepted answer

Permanent link

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

1 vote

Comments

Thank you so much David. 

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
× 10,948

Question asked: Nov 08 '18, 8:22 a.m.

Question was seen: 1,883 times

Last updated: Nov 08 '18, 5:42 p.m.

Confirmation Cancel Confirm