Java API to fetch baselines of a component w.r.t to a perticular stream.
Hello,
I need to fetch only those baseline details of a component which are part of a particular stream. In the below code I am getting complete set of baselines history for a component which is shared among different streams.
I want to limit the result by filtering it by stream name.
workspaceManager.findBaselines(IBaselineSearchCriteria.FACTORY.newInstance().setComponentRequired(component), Integer.MAX_VALUE, newChild);
Requesting you to please provide plain Java API to achieve this.
Regards,
Swapnil
One answer
Reverse your thinking: the component has no idea where its change sets and baselines are being used. The stream does.
Obtain the Stream handle (basically IFlowNodeConnection ; it is the same object for a Workspace).
Then call IFlowNodeConnection#getComponents , iterate over result until you find the component handle you are looking for. Use that handle as input for:
IFlowNodeConnection#getBaselinesInHistory(IComponentHandle component
,
int max, IProgressMonitor monitor
)
Look at the returned IHistoricBaselineIterator in the SDK doc to see how you can getBaselines and use hasPrevious and getPrevious to get the whole list of baselines this component has in this stream.
If this answers your question please mark it as accepted.
- Arne