Obtain a list of baselines for a component in a workspace
Patrick Leyman (30●4●4)
| asked Dec 02 '10, 4:08 a.m.
edited Jun 01 '16, 11:26 p.m. by David Lafreniere (4.8k●7)
Hi,
I want to recover via the Java API a list of baselines of a component, but filtered for a specific workspace. I can obtain a list of baselines for a component but across all workspaces. I want this list filtered for just one specific workspace. I'm using the following code to get a complete list for a component but I don't know how to filter this for a given workspace(Handle)
Anyone knows how to filter this list further per workspace? Or do I need another approach to get this working? Thanks in advance. |
7 answers
Hi..
Do you know how to resolve this problem now??? I have the same trouble.... thanks |
Hi.. As a matter of a fact, we found a solution yes. Via the WorkspaceConnection object you can use the getBaseLinesInHistory(comp, qty, monitor) method. This method returns a IHistoricBaselineIterator which contains a list of baselines. My method to recover the last baseline for a component in my workspace:
I hope it helps. Regards, Patrick |
Hi,
I've a similar problem. I'd like to compare the baseline automatically created by a build request with the previous one. In this cas I've found that getBaselinesInHistory method does not return the same content I would have if I select "Show Baselines" in client but only the baseline in the history. For example if I select show baselines on my repository workspace I obtain this list: 12: RI000_add_TestVari_20120223-0930, sa_RTC, 9.30.26 (1 ora fa) but if I run getBaselinesInHistory I only get 12: RI000_add_TestVari_20120223-0930, sa_RTC, 9.30.26 (1 ora fa) What is the method I can call to obtain the same of show baselines command? Thanks, Michele. |
Michele , the answer you seek is in the first post of this thread ;-)
|
David,
thanks for you answer but this code does not work for me because I'm searching for baseline in a specific workspace. I've just tried another method which works quite the way I need: getMergedBaselineHistory. This method has only a problem: it returns some duplicate line. This is ok if the duplicates are not subsequent (because of replace history) but it returns also, in some case, the same baseline two times one after the other. I resolved removing subsequent duplicates and so I obtain the same list I have with client command. Best regards, Michele. |
Hi Michele,
To automatically compare the baseline against the previous one, which operation is your plugin based on? I mean is it an Operation particpant and if yes, where is it configured in the operation behaviour? Thanks. |
I think that the right answer is here link . If you want a list of the specific stream or workspace component baselines (like what you get from ui when you right click on the component of a workspace and then you select show > baselines) you've just to change the parameters from
to
where myMax is the maximum number of baselines you want, paying attention that the list is from oldest to newest
|
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.