How to read the Build Queue of a particular RTC Project.
![]()
Hello Everybody,
I have created a RTC project and put a single component inside it. I have also created 2 build engines and a single build definition which is designated to be run on any of the two available build engines. What I also want to do is to monitor the "Build Queue" of this project programmatically, and see whether there is an item in that queue which is in "pending" state. I have download the Jazz SDK, and seen some examples of triggering builds but I still have not been able to figure this one out. With Regards Swapnonil Mukherjee |
5 answers
![]()
Hi Swapnonil,
The one we use internally is: com.ibm.team.build.internal.client.ITeamBuildRecordClient.getBuildResultRecords(IProjectAreaHandle, BuildState[], String[], IProgressMonitor): /** The client interface can be obtained using: com.ibm.team.repository.client.ITeamRepository.getClientLibrary(Class) Note that this is internal though. To avoid using the internals, you'd need to construct your own query and use com.ibm.team.build.client.ITeamBuildBaseClient.queryItems(IItemQuery, Object[], int, IProgressMonitor) |
![]()
Hi Nick,
Does the getBuildResultRecords return the queued builds ie even if the build is in pending sate(not started)? Their is a "getQueue" REST call <repository>/jazz/resource/virtual/build/queue?projectAreaUUID=<item> &profile=REDUCED which returns the items in the build queue. Is their a similar API on the Jazz SDK side or its subsumed by getBuildResultRecords. Thanks Kishore |
![]()
Hi Kishore,
Yes, to see the build queue for the project, use that getBuildResultRecords with states BuildState.NOT_STARTED (aka pending) and BuildState.IN_PROGRESS. |
![]()
Hi Everybody
The code that helped me browse the build queue is pasted below.
However I do not know if this is the best way do so. With Regards Swapnonil Mukherjee |
![]()
That looks fine, except that we also show in-progress builds in the queue in the UI. Also, the use of internals isn't ideal.
|