It's all about the answers!

Ask a question

How to export ProcessTemplate At projectArea Level by JAVA API


ast java (4512049) | asked Jan 19 '17, 12:37 a.m.

Hi Team,

Is there any JAVA API to export processTemplate at project Area level directly.
we can see the icon beside to explore ProjectArea.

One answer



permanent link
Ralph Schoon (63.6k33647) | answered Jan 19 '17, 2:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Comments
ast java commented Jan 19 '17, 3:47 a.m.

Hi  Ralph,
Earlier we was used to do the same which mentioned in post. creating new definition each time and after export deleting the definition.

but now in web client we have an option to directly export the template at project area level. Is there any such API which i can use to export directly from project level.


Ralph Schoon commented Jan 19 '17, 4:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

From the next two or three answers in the Google search: No.


ast java commented Jan 19 '17, 5:04 a.m.

Hi Ralph,
An last doubt. when i use below API to export ProcessTemplate, its failing to export newly attribute added to project area. for example if if add new attribute to work item, that field is not exported in later export.

IProcessDefinitionHandle processDefinintionHandel = projectArea.getProcessDefinition();
IContent content =
        ((IProcessInternalClientService) this.teamRepo.getClientLibrary(IProcessInternalClientService.class))
            .createProcessDefinitionExportZip(processDefinintionHandel .getItemId().getUuidValue(), new SubProgressMonitor(
                subProgressMonitor, 200));


Ralph Schoon commented Jan 19 '17, 5:15 a.m. | edited Jan 19 '17, 5:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I believe you should really, really read https://jazz.net/forum/questions/216148/export-process-template-from-project-area-via-api-why-do-file-name-suffixes-in-processdescriptionzip-change-between-subsequent-exports completely. Richard explains some issues and corrects how to create a new process-definition from the project area, before downloading it in his answer.


ast java commented Jan 19 '17, 5:35 a.m.

Yes Ralph, I am aware of it and till now we were doing the same.
But now we have faced some issue. we cant export the template which has same name as project area existing on web.
 And for this we were creating new definition with time stamp to avoid it.
But now there is an "ICON" in web UI (beside explore PA) where directly export the template from project area level , we are trying another approach by sending project area definition to export, Here  we are not able to export new values.


Ralph Schoon commented Jan 19 '17, 5:54 a.m. | edited Jan 19 '17, 6:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your code above does not match the code Richard uses.

The button is to "Export Process Template" has been there since several releases and, as far as I can tell, does exactly the same as the Eclipse UI (and createProcessDefinitionFromProjectArea which your code does not use) it extracts a process template. The UI then stores it in the process templates section of RTC, from where you can download the template. You will need a unique ID for the export - this has always been the case as well.    




Marko Tomljenovic commented Jan 19 '17, 5:36 p.m. | edited Jan 19 '17, 5:37 p.m.

Hello Ralph,
your explanation is likely not correct.
I tried the following:

1. I checked the templates that are already existing on the server. I wrote down the name and id of an existing template.
2. Now I chose an arbitrary project area.
3. I clicked on the mentioned button in the web ui.
4. In the dialog I gave exactly the id and name of the already existing template.
5. I could press on OK and also the zip file got created properly.
6. After that I went to the Templates Overview page in the web client and exported the template whose id and name I hijacked.
7. After downloading the zip and comparing it with the previous zip it is clear that the two zips although having the same file name are belonging to two different process configurations.


Ralph Schoon commented Jan 20 '17, 3:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Marko, you are correct, I should have pressed the save button. This is a new behavior that I have not worked with. In the past you always had to create a template of the process to download this. My bad.

I have no idea how to find the Java API involved wit this at the moment.

showing 5 of 8 show 3 more comments

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.