It's all about the answers!

Ask a question

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


ast java (4512049) | asked Feb 08 '16, 5:11 a.m.
Hi Team,
Is there any way to export specified process template using RTC API to the local system(Sandbox).

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Feb 08 '16, 7:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 08 '16, 7:22 a.m.
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

Your answer


Register or 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.