It's all about the answers!

Ask a question

How to collect all Snapshots(BaselineSets) linked with Baseline?


Vijayanand Karunanithi (1527) | asked May 30 '18, 1:31 a.m.

How to collect all Snapshots(BaselineSets) linked with Baseline?

 

I have a Stream and i have created Baseline for Component In ALM.

I have created more than one Snapshot with the same reference of baseline(Baseline UUID).

 

In that case, how to collect all the BaselineSet which linked with Baseline(Baseline UUID)?

 

Note: Usually we can collect all the Baselines from BaselineSet.

But this is like reverse case, from Baseline collecting all the linked BaselineSets(Snapshots).

Accepted answer


permanent link
David Lafreniere (4.8k7) | answered Jun 01 '18, 2:02 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
The following API can be used to find all snapshots that contain a specific baseline:

IBaselineSetSearchCriteria.getContainsBaselinesOptional() (Note: You would first 'get' the list, then add the desired IBaselineHandle to that list)

Note: This API was added in RTC 6.0.2, so hopefully your RTC version is equal or greater to that version.
Vijayanand Karunanithi selected this answer as the correct answer

Comments
Vijayanand Karunanithi commented Jun 20 '18, 7:54 a.m.

I have tried that and it is not working for me.
Please find the code which i have used to identify all snapshot.

 - Created object for IBaselineSetSearchCriteria
 - Got List<IBaselineHandle> using getContainsBaselinesOptional and add my bselineHandle object into it.
 - Have set ProcessArea for IBaselineSearchCriteria
 - Called "findBaselineSets" method from WorkspaceManager class along with input parameter of IBaselineSetSearchCriteria.

This snippet is always returning empty list.

Kindly help me to resolve the issue.

Thanks in advance!!


David Lafreniere commented Jun 20 '18, 11:07 a.m. | edited Jun 20 '18, 11:10 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
By setting the [optional] process area in the IBaselineSetSearchCriteria, it means you are only finding snapshots that are owned by a stream, where that stream is owned by that process area. This means the result will never return a snapshot that is owned by a repository workspace, or snapshots owned by a stream, which is owned by a different process area.
Can you try 'not' setting the process area in the IBaselineSetSearchCriteria and see if this fixes your issue?

I suppose the other question is: "Are you 100% sure there is even a snapshot that contains the baseline? There's no reason to assume a random baseline is contained in a snapshot in the repository".

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.