Export process template from project area via API: Why do file name suffixes in processdescription.zip change between subsequent exports?
Hi,
First, I have to mention that I use a custom tool for export/importing process templates via RTC Plain Java Client API).
What I target at with this question is understanding the process of how and when the processdescription.zip (inner zip file in the template's export zip file) is generated during export via API. Just to give you an overview – the following workflow steps lead me to my question:
All files on the left side have the same suffix in their file name (printed in bold in the above example). The same for the right side. But the suffixes are different between left and right. Where do the suffixes come from? Why do they differ?
It would help me a lot if someone could tell me what the suffix of the files in the processdescription.zip means (e.g. "_zn7qQMTvEeW-ibGVJnpTpA.zh_TW._zn7qT8TvEeW-ibGVJnpTpA"). To me it looks like a UUID. Why does it change between subsequent exports? Is it because I update the PA content with my tool or is it just generated during the export of the template. Is there a way to avoid this behavior (e.g. to make this suffix constant between subsequent exports)?
Side note: The API calls used to export the template from a PA in my tool:
Best regards,
Richard
First, I have to mention that I use a custom tool for export/importing process templates via RTC Plain Java Client API).
What I target at with this question is understanding the process of how and when the processdescription.zip (inner zip file in the template's export zip file) is generated during export via API. Just to give you an overview – the following workflow steps lead me to my question:
- Create a new project area (PA) from a template on RTC.
- Export the template from this PA with the mentioned tool. This includes downloading and extracting the template ZIP file and moving/renaming some files in the attachments.
- Update a project area on RTC with content from the template on the local file system using the tool from step 2. No changes in the exported template between step 2 and step 3.
- Export the template from RTC again as in step 2.
left side:
ProcessDescription.Formal_Project_Management_Process_Templa._zn7qQMTvEeW-ibGVJnpTpA.zh_TW._zn7qT8TvEeW-ibGVJnpTpA.xml
right side:
ProcessDescription.Formal_Project_Management_Process_Templa._pGZlMMTvEeW-ibGVJnpTpA.zh_TW._pGZlP8TvEeW-ibGVJnpTpA.xml
All files on the left side have the same suffix in their file name (printed in bold in the above example). The same for the right side. But the suffixes are different between left and right. Where do the suffixes come from? Why do they differ?
It would help me a lot if someone could tell me what the suffix of the files in the processdescription.zip means (e.g. "_zn7qQMTvEeW-ibGVJnpTpA.zh_TW._zn7qT8TvEeW-ibGVJnpTpA"). To me it looks like a UUID. Why does it change between subsequent exports? Is it because I update the PA content with my tool or is it just generated during the export of the template. Is there a way to avoid this behavior (e.g. to make this suffix constant between subsequent exports)?
Side note: The API calls used to export the template from a PA in my tool:
IProcessDefinition definition =((ProcessClientService) this.service).createProcessDefinitionFromProjectArea(projectAreaHandle,this.rtcProjectAreaName, this.rtcProjectAreaName.toLowerCase(), "", this.monitor);IContent content =((IProcessInternalClientService) this.teamRepo.getClientLibrary(IProcessInternalClientService.class)).createProcessDefinitionExportZip(definition.getItemId().getUuidValue(), new SubProgressMonitor(subProgressMonitor, 200));
I would really appreciate any hint on this topic.deleteCreatedProcessDefinition(definition);
Best regards,
Richard
Accepted answer
I played around a little with the source code of the tool.
The following changes seem to produce the behaviour I actually require.
The reason why I am asking is that I suspect that the person who originally wrote the code had some reason for doing it the way it is.
The following changes seem to produce the behaviour I actually require.
definition = findExistingProcessDefinition(); if (definition == null) {Is this a safe solution? Does it have any side effects? I mean are there cases where some external instance deletes the process definition and it will be created again?
definition = ((ProcessClientService) this.service).createProcessDefinitionFromProjectArea(projectAreaHandle,this.rtcProjectAreaName, this.rtcProjectAreaName.toLowerCase(), "", this.monitor);
}
/* ... (export as shown above) */
// REMOVED deleteCreatedProcessDefinition(definition);
The reason why I am asking is that I suspect that the person who originally wrote the code had some reason for doing it the way it is.