cancel
Showing results for 
Search instead for 
Did you mean: 

History variables in parallel executions

walterjs
Champ in-the-making
Champ in-the-making
I've noticed that when history is on full and a parallel task completes with variables associated with it:
taskService.complete(taskId, vars);
the variables are not saved against the activityInstanceId or the execution it is running in, but only against the process instance.

I've created a JIRA for this http://jira.codehaus.org/browse/ACT-815 with a test case that shows what is happening.
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Thanx for the jira. I'll look into it.

vicziani
Champ in-the-making
Champ in-the-making
Any progress? I think, it is a serious bug. I would like to show the value of the variable connected to the activity. There is a Jira issue (created on 16/May/11) and test case too.
Could you suggest any workaround?

frederikherema1
Star Contributor
Star Contributor
Workaround:

- Use taskService.setvariablesLocal() or delegateTask.setVariableLocal() to ensure task-id is used in history, instead of passing the when calling "completeTask"
- THe variables passed in taskService.complete are written to the process-instance indeed, this is normal behavior. By default (not using setVariableLocal) If there is no variable present for a given key in the task/execution, the parent is checked. If the value key is present on the parent it's set there. This goes on until the root of the execution-tree. If process-instance is reached and no child-executions contained the variable already, it's set on the process-instance.

vicziani
Champ in-the-making
Champ in-the-making
It works like a charm! Thank you!

Workaround:

- Use taskService.setvariablesLocal() or delegateTask.setVariableLocal() to ensure task-id is used in history, instead of passing the when calling "completeTask"
- THe variables passed in taskService.complete are written to the process-instance indeed, this is normal behavior. By default (not using setVariableLocal) If there is no variable present for a given key in the task/execution, the parent is checked. If the value key is present on the parent it's set there. This goes on until the root of the execution-tree. If process-instance is reached and no child-executions contained the variable already, it's set on the process-instance.