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

Is it possible to set the workspace Name for a personal build using RTC SDK?

 I am in the process of developing a deliver (server) adviser which is kicking off a personal build in the same workspace as the deliver operation was performed.

Here is a snippet of the current function. The current code kicks off the build in the workspace listed in the build definition (which is no good for me).

protected void build() throws TeamRepositoryException {

ITeamBuildService buildService = getService(ITeamBuildService.class);
IBuildDefinition buildDef = buildService.getBuildDefinition("CopyToPublic");

ITeamBuildRequestService brService = getService(ITeamBuildRequestService.class);
/* 
* Kickoff a personal build
*/
IItemsResponse response = brService.requestBuild(buildDef, null,
null, true, true);

}

How do I specify in the request build process to perform the build in a different workspace?

Appreaciate your assistance,
Liora

0 votes



One answer

Permanent link
 I figured it out. Here is the code snippet:

protected void build(IWorkspace workspace) throws TeamRepositoryException {

ITeamBuildService buildService = getService(ITeamBuildService.class);
IBuildDefinition buildDef = (IBuildDefinition) buildService.getBuildDefinition("CopyToPublic");
IBuildProperty[] buildProperties = new IBuildProperty[2];
buildProperties[0] = BuildItemFactory.createBuildProperty(IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID,
workspace.getItemId().getUuidValue());
buildProperties[1] = BuildItemFactory.createBuildProperty("loadDir", "c:\\tmp\\loadDir");

ITeamBuildRequestService brService = getService(ITeamBuildRequestService.class);
IItemsResponse response = brService.requestBuild(buildDef, buildProperties, null, true, true);
}

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

Question asked: Oct 12 '12, 7:17 p.m.

Question was seen: 3,834 times

Last updated: Oct 13 '12, 11:15 a.m.

Confirmation Cancel Confirm