Bug in treatment of HistoricDetail (VariableUpdate type)

Description

Hello,

I found a bug in the treatment of HistoricDetail (VariableUpdate type) in later versions to 5.16.4.
It is occours when I store variables in a UserTask with "processEngine.getTaskService().setVariable()", without completing the UserTask.

If I store variables with:
processEngine.getTaskService().setVariable(taskId, "var_1", "this is a save var");
With activiti 5.19.0.2. In the database. ACT_HI_DETAIL table: the "ACT_INST_ID_" field is null.
With activiti 5.16.4 the field has the correct value (the ID of the activity).

I attached two JUnit tests to prove it: activiti-unit-test-hcovardetail_5.16.4_OK.zip and activiti-unit-test-hcovardetail_5.19.0.2_FAIL.zip

Thanks.

Environment

None

Activity

Show:
Vlad Stan
November 8, 2016, 11:19 AM
Edited

@Aitor: thanks for the detailed bug description and for the unit tests, they have been very useful.

Indeed the problem was that the ACT_INST_ID_ value was not inserted, thus the query did not returned the entry. See

In order to reproduce it the HistoryLevel must be set to FULL.

The bug was introduced in this commit some time ago:

I have fixed it and created a pull request:
https://github.com/Activiti/Activiti/pull/1068

Assignee

Joram Barrez

Reporter

Aitor Rodríguez

Labels

Components

Affects versions

Priority

High
Configure