Request historic task variables is empty
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2013 09:32 AM
Hi,
i tried to request variables of completed user tasks, but allways get an empty list, when executing:
List<HistoricVariableInstance> variables = historyService.createHistoricVariableInstanceQuery().taskId(historicTask.getId()).list();
Using the taskService dows not work for historic tasks. This will cause an error:
Map<String, Object> variables2 = taskService.getVariables(historicTask.getId());
What i did, to store the variables:
taskService.setVariables(taskId, parameterMap); Map<String, Object> variablesToVerify = taskService.getVariables(taskId); taskService.complete(taskId);
Directly after storing the variables, i could verify, they have been saved, because the variables are included in [variablesToVerify]
Does anyone know, how to request variables of historic tasks? Do i have to use a native query? Can someone help me with the native SQL query?
Thanks
Dominik
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2013 03:08 AM
Hi Dominik,
The variable instance query is the one you should use for this. What history level are you using?
How did you retrieve the historicTask variable?
Best regards,
The variable instance query is the one you should use for this. What history level are you using?
How did you retrieve the historicTask variable?
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2013 03:12 AM
Hi trademak,
the history level was set to audit. I now changed this to full in my spring activiti configuration. Nevertheless, the list of historic variables is empty.
The way, I retrieve the historic task is:
<java>
List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery().finished().processInstanceId(processInstanceId).list();
</java>
Best regards
Dominik
the history level was set to audit. I now changed this to full in my spring activiti configuration. Nevertheless, the list of historic variables is empty.
The way, I retrieve the historic task is:
<java>
List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery().finished().processInstanceId(processInstanceId).list();
</java>
Best regards
Dominik
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2013 04:37 AM
Audit should also be file to fill the variables in the historic variables table.
You are using Activiti 5.12, right?
Can you create a unit test that shows your issue?
Best regards,
You are using Activiti 5.12, right?
Can you create a unit test that shows your issue?
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2013 01:39 PM
Hi Tijs,
I created today with Dominik together a example process and a unit test to reproduce the problem.
https://github.com/MPriess/activiti-historyservice
Best regards,
Michael and Dominik
I created today with Dominik together a example process and a unit test to reproduce the problem.
https://github.com/MPriess/activiti-historyservice
Best regards,
Michael and Dominik
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2013 05:14 AM
WHen submitting a task-form, the variables are flushed to the process instance, they are not task-local. Only taskLocal (taskService.setVariableLocal()) are recored with a taskId in the history.
So those values are recorded in the history as "process" variables, rather than task-variables. This is not a bug…
So those values are recorded in the history as "process" variables, rather than task-variables. This is not a bug…