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

Query Build Definitions by Team Area

My team manages many builds across many repositories. Given a list of repositories, I'd like to find all builds owned by my team.

It is simple and quick (~1s) to get all the build definitions in a repository using the IBuildDefinitionQueryModel. However, I would like to limit the query results to only those definitions owned by my team. I cannot find a way to build this into my query. Currently I find all the definitions in the repository and then check the definitions process area to see if it matches mine. This approach returns the correct results but is significantly slower (~5-10s). Since this page will eventually be a publicly facing aggregated list of builds 10s will not cut it. Can I add a process area to my query filter?

Should I be able to expect the RTC server to be able to handle this type of live querying for builds/results or should I look into another approach, like maintaining a separate list of hosted builds in an external database?

Thanks,
-Dave

1 vote

Comments

Hello Dave,

Could you advise how to use IBuildDefinitionQueryModel? I got the native SDK but I can only find this class interface to com.ibm.team.build.common.model.query.IBaseBuildDefinitionQueryModel. Not sure how to use this. I have this code snippet -

            IItemQuery itemQuery = IItemQuery.FACTORY.newInstance(IBuildDefinitionQueryModel.ROOT);

 Sorry Sunil.  I wrote this code several years ago and I no longer have access to it.  Try responding to Nick's comment below.

Hi Sunil, IBuildDefinitionQueryModel is a static member type of IBaseBuildDefinitionQueryModel:

com.ibm.team.build.common.model.query.IBaseBuildDefinitionQueryModel.IBuildDefinitionQueryModel
 
The only property exposed to filter by is the definition id, though.  The internal one at com.ibm.team.build.internal.common.model.query.BaseBuildDefinitionQueryModel.BuildDefinitionQueryModel lets you filter by owning process area and/or configuration element id, in addition to id.

 Once the query is configured the way you want, you can run it using:

com.ibm.team.build.client.ClientFactory.getTeamBuildClient(anITeamRepository).queryItems(IItemQuery, Object[], int, IProgressMonitor), where the 2nd arg takes the values of any variable parts of the query, which should be specified as input args when configuring the query's filter.


 See also https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples

1 vote



One answer

Permanent link
 Sorry for the long delay on this.  There are two possibiliies:
1) keep with the current approach, but avoid transferring all info about the definitions by specifying reduce list of properties when you fetch the items, e.g. fetch only build definition id and owner
2) cast down to internal com.ibm.team.build.internal.common.model.query.BaseBuildDefinitionQueryModel.processArea()
and filter on that

1 vote

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,927
× 562
× 411

Question asked: Mar 16 '10, 3:31 p.m.

Question was seen: 8,410 times

Last updated: Mar 14 '13, 5:07 p.m.

Confirmation Cancel Confirm