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

How to fetch Modified baselineHandles after a certain date using i baseline serach criteria with only modifiedafter as a search criteria.

Hi All,

I have been trying to fetch modified baselineHandles after a certain date so i used IBaselineSearchCriteria my method is below

public static List<IBaselineHandle> getModifiedBaselinesAfterDate(final Date after, final ITeamRepository repository,
      final IProgressMonitor monitor) throws TeamRepositoryException {
    IBaselineSearchCriteria baselineSearchCriteria = IBaselineSearchCriteria.FACTORY.newInstance();
    baselineSearchCriteria.setModifiedAfterOptional(after);
    List<IBaselineHandle> listIBaselineHandles =
        getWorkSpaceManager(repository).findBaselines(baselineSearchCriteria, Integer.MAX_VALUE, monitor);
    if (CollectionUtils.isEmpty(listIBaselineHandles)) {
      return (Collections.EMPTY_LIST);
    }
    return listIBaselineHandles;
  }

But it fails with following exception

java.lang.IllegalArgumentException

       at com.ibm.team.scm.client.internal.WorkspaceManager.findBaselines(WorkspaceManager.java:2082) ~[com.ibm.team.scm.client-5.0.2.jar:?]

So i found out that i should also set the component handle ebfore i can use the IBaseline searchcriteria for the baseline.
This is difficult to do for me as in my scenario I have a lot of components and then I would have to get all the handles and then iterate through them as I don't know which component has changed baselines which will be a performance hit . Could you please suggest some better alternative way.Thanks in advance.

0 votes



One answer

Permanent link
I think you will need to go with the alternative you have already thought about. Baselines are created for a component and therefore findBaselines() won't work without a component.
When you are searching for baselines based on a date range, and if a component does not have a baseline in that date range,  the result should be empty. If you have a list of components, running the search on each one of them and combining the result should give you the desired baselines.

0 votes

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,943

Question asked: Jan 12 '16, 11:44 p.m.

Question was seen: 2,106 times

Last updated: Feb 03 '16, 7:12 p.m.

Confirmation Cancel Confirm