Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Extending Jazz Build Engine - How to create a workspace from tag and then load that workspace

I am working on a preBuildParticipant that will, take a builddefinitionid and label, get the asociated snapshot, create a repository worksapce and then load that workspace.

I have managed to get a snapshot as a "IBaselineSet". From here, I am unsure how I will actually create a workspace. I have tried to use the createWorkspaceFromBaselineSet in the IScmService, with no joy.

Code as follows (where getSnapshot is my method):

IBaselineSet snapshot = getSnapshot(buildClient, buildResult,
monitor, repo);
getBuildLog().println("creating workspace manager");
WorkspaceManager workspaceManager = (WorkspaceManager) SCMPlatform.getWorkspaceManager(repo);
getBuildLog().println("creating contributionHandler");
IContributorHandle contributorHandle = (IContributorHandle) IContributor.ITEM_TYPE.createItemHandle(snapshot.getItemId(),null);
getBuildLog().println("creating scm service");
IScmService service = workspaceManager.getServerConfigurationService();
getBuildLog().println("creating baselinesethandle");
IBaselineSetHandle baselineSetHandle = (IBaselineSetHandle) IBaselineSet.ITEM_TYPE.createItemHandle(snapshot.getItemId(),null);
getBuildLog().println("executing create workspace");
WorkspaceRefreshResult result = service.createWorkspaceFromBaselineSet(contributorHandle, snapshot.getName() + "_test!!!!",
                   "test", baselineSetHandle,IRepositoryProgressMonitor.ITEM_FACTORY.createItem(monitor));
//checkoutSnapshot(snapshot);
return BuildStatus.OK;

0 votes


Be the first one to answer this question!

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

Question asked: Aug 28 '14, 12:42 p.m.

Question was seen: 3,219 times

Last updated: Aug 28 '14, 12:42 p.m.

Confirmation Cancel Confirm