Possible Process Variable History Subprocess Scope Bug

I discovered a possible bug with history process variables involving a sub-process scope. The smallest possible example for reproducing this behavior can be seen in the image below:

The variables value update is lost in the history, if it is manipulated in a sub-process scope, even though its value is passed along correctly throughout the whole process. It is important that the variable is a complex type, otherwise I assume the effect is not reproducible.

The process engine test project is attached below:
Process Engine Test Scope History Bug

Hi Robert,

Thanks for reporting this and creating an executable test case, that makes it easy to understand the problem. I created a bug report: https://app.camunda.com/jira/browse/CAM-7610

In general, the problem only shows up for implicit updates of object values, i.e. where you change an attribute of an object that also happens to be a process variable. My recommendation would be to use the variable API whenever you change a value, i.e. DelegateExecution#setVariable etc. The engine’s “magical” behavior to detect such changes was and still is rather error-prone.

Cheers,
Thorben

Hi Thorben,

good to know, thanks for your support.