cancel
Showing results for 
Search instead for 
Did you mean: 

ExecutionId differs for task from taskservice versus historyService

christianscheer
Champ in-the-making
Champ in-the-making
I get a different executionId for the same task, depending on my type of query.

List<Task> tasks = taskService.createTaskQuery().taskAssignee(userName).list();
//no, that "9" is not hard coded.
tasks.get(9).getId() // 36033
tasks.get(9).getExecutionId // 33107

Task task = historyService.createHistoricTaskInstanceQuery().taskId(36033).singleResult();
task.getExecutionId // 36028


Activiti Version is 5.16.4, but i think the few task concerned by this where created before we upgraded. The old version was 5.14.
The history-property is not configured, so i guess it's 'audit'.

Is this indented and i have understood something wrong?
Or did i stumple upon a bug or use the Activiti API wrong?

I will happily provide more information if needed, but my understanding so far is, that the executionId should match.

SQL:
<blockcode>
select ID_,EXECUTION_ID_ from act_hi_taskinst where id_ = 36033;
->36033, 36028

select ID_,EXECUTION_ID_ from act_ru_task where id_ = 36033;
-> 36033, 33107
</blockcode>
4 REPLIES 4

christianscheer
Champ in-the-making
Champ in-the-making
Typo in Line 6 of my Code, it's obviously
<java>HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery()…</java>

jbarrez
Star Contributor
Star Contributor
Execution id's should match for sure. It seems very strange that you are seeing this behaviour using the engine API's. You don't happen to have a unit test that demonstrates the problem?

christianscheer
Champ in-the-making
Champ in-the-making
>Execution id's should match for sure
Thanks for the confirmation.

Now that i know that this is a bug, I will try to find a way to reproduce that behaviour. Right now i have got large processes and a whole application around them. 20 out of ~80000 tasks are in this strange state. I will get back to you asap.

jbarrez
Star Contributor
Star Contributor
Thanks. It does sound very (very!) strange, so more info would be helpful.