cancel
Showing results for 
Search instead for 
Did you mean: 

TaskDefinition for historic tasks

tanja1
Champ in-the-making
Champ in-the-making
We need to show the form data for historical tasks.
As the FormService only provides for task form data for active tasks we have to implement our own HistoricalFormService that retrieves the form data using the task definition and the historical detail data for the latest variable updates.
Is there a way to get the task definition for a historical task? Or is it possible to parse the bpmn.xml without deploying it?
9 REPLIES 9

trademak
Star Contributor
Star Contributor
Did you have a look at the HistoryService?
Here you can retrieve historic tasks.

Best regards,

tanja1
Champ in-the-making
Champ in-the-making
Yes, we do get the historic tasks using the HistoryService. But they do not have any information about the form data, don't they? Surely we could get the historic variables and filter all variables out that are no form data but then we still do not have the labels defined in the form data and all the information that we get in the TaskFormData using the FormService.getTaskFormData.

Best regards,
Tanja

Did you have a look at the HistoryService?
Here you can retrieve historic tasks.

Best regards,

tanja1
Champ in-the-making
Champ in-the-making
I managed to read the TaskDefinition for a historical task by implementing a new Command used by an extension of the FormServiceImpl. Here a new BpmnParser is instantiated that parses the corresponding Resource of the historical processDefinition. Unfortunately this helps only partially because there exist no form handler for historical tasks.

It seems as there is no possibility to read the form data of historical tasks and we have to implement our own FormHandler for HistoricTaskInstanceEntity (what means we have to duplicate lots of code of the DefaultFormHandler  😞 ). Or did I miss something in the Activiti API? Have you planned to provide for an API for reading historical task form data?

Best regards,
Tanja

trademak
Star Contributor
Star Contributor
Hi,

With the HistoricDetailQuery you can retrieve the form property values. That's what you are looking for right?

Best regards,

tanja1
Champ in-the-making
Champ in-the-making
Hi Tijs,

thank you for your reply but this is not exactly what we need. In addition to the property values we need the form property meta data, i.e. we need the TaskFormData object and its FormProperty list for the historical tasks. For running tasks this is provided by the FormService interface but there is no implementation for completed tasks.

Best regards,
Tanja

cr2121
Champ in-the-making
Champ in-the-making
I hava the same question.

trademak
Star Contributor
Star Contributor
You can get the form property definition by getting the BpmnModel of the process definition. In the BpmnModel you can get the UserTask and its form properties.

Best regards,

liun8917
Champ in-the-making
Champ in-the-making
Still can not use task form to set properties in rendering in archived page even I got the form properties from UserTask. Any idea?

cr2121
Champ in-the-making
Champ in-the-making
Thank you trademak! It works!