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

How to export only specified process template to the sandbox(Local system) using RTC API

Hi Team,
Is there any way to export specified process template using RTC API to the local system(Sandbox).

0 votes


Accepted answer

Permanent link
Look at com.ibm.team.process.internal.ide.ui.wizards.ExportProcessDefinitionWizard.exportToArchive(IProcessDefinition, File, IProgressMonitor). You can find the class in the Eclipse client using Plugin Spy (SHIFT+ALT+F1) on the export wizard that you can open from looking at the process template administration. This shows the code if you have setup RTC with the SDK.

It is however internal API:


	/**
	 * Exports the given process definition to the given archive file.
	 * 
	 * @param definition the definition to export
	 * @param archive the archive file to export into.
	 */
	private void exportToArchive(IProcessDefinition definition, File archive, IProgressMonitor monitor) throws TeamRepositoryException {
		monitor.beginTask("", 1000); //$NON-NLS-1$
		// get exported file from server
		IProcessInternalClientService processService = (IProcessInternalClientService) fWizardContext.fTeamRepository.getClientLibrary(IProcessInternalClientService.class);
		IContent content = processService.createProcessDefinitionExportZip(definition.getItemId().getUuidValue(), new SubProgressMonitor(monitor, 200));
		
		// write content to file
		try {
			FileOutputStream stream = new FileOutputStream(archive);
			fWizardContext.fTeamRepository.contentManager().retrieveContent(content, stream, new SubProgressMonitor(monitor, 800));
		} catch (FileNotFoundException e) {
			throw new TeamRepositoryException(e);
		}
	}
ast java selected this answer as the correct answer

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

Question asked: Feb 08 '16, 5:11 a.m.

Question was seen: 1,397 times

Last updated: Feb 08 '16, 7:22 a.m.

Confirmation Cancel Confirm