IBuildEngine and IBuildDefinition, client side java api, how to ?
I have looked thru the forum for some guidance on how to get the list of BuildEngines and associated BuildDefinitions from a client side (plain java) app..
https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples
clearly I am missing something.
I see that I can run a 'query' to get build definitions that match certain criteria, but I don't think this is the approach to use.
I am on the last step of our copy project utility, and I need to copy the build engines and definitions.
can someone turn the light on and point to the page of enlightenment?
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Jan 08 '14, 9:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sam, I found this code in com.ibm.team.build.internal.ui.dialogs.definitions.FetchBuildDefinitionsInConnectedProjectAreasJob. Maybe that helps sorting it out?
protected IBuildDefinition[] fetchBuildDefinitions(ITeamRepository repository, IProgressMonitor monitor) throws TeamRepositoryException { IItemQuery itemQuery = IItemQuery.FACTORY.newInstance(IBuildDefinitionQueryModel.ROOT); // get the team areas for the connected project areas in the repo and // use them to narrow the search IProcessAreaHandle[] processAreaHandles = getProcessAreaHandles(repository, monitor); IItemHandleInputArg[] itemHandleArgs = new IItemHandleInputArg[processAreaHandles.length]; for (int i = 0; i < processAreaHandles.length; i++) { itemHandleArgs[i] = itemQuery.newItemHandleArg(); } // create the query IBuildDefinitionQueryModel buildDefinitionQueryModel = IBuildDefinitionQueryModel.ROOT; final IItemQuery query = IItemQuery.FACTORY.newInstance(buildDefinitionQueryModel); IPredicate filter = ((BuildDefinitionQueryModel) buildDefinitionQueryModel).processArea()._in(itemHandleArgs); query.filter(filter); query.orderByDscUsingLocale(buildDefinitionQueryModel.id()); // get the results IItemManager itemManager = repository.itemManager(); ItemQueryIterator sam detweiler selected this answer as the correct answer
Comments
sam detweiler
commented Jan 08 '14, 10:17 a.m.
funny.. look at my other answer and that is the code I built!..
thank you..
|
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.