I debugged the NullpointerException. It´s not the historyProcessInstance that it null, but it´s histroyVariables Map! Any idea why this happens?
I´ve come back to this and tested it again. What Jaber is saying is correct. I can read back the history variables after the transaction. But why is it like that? In my understanding, when terminating a process, everything concerning history should be written to the db and after that we should be able to read it back - in the same transaction of course. As long as we´re in the same transaction everything should be readable even without a commit, shouldn´t it? Why is there the need to end the transaction?
Currently, we´re only stuck with that issue in our tests. But I can image reasonable real world scenarios, where such a constellation could happen. For example, you´ve written a framework around your workflows that checks after each processing step if the concerned process has ended, if yes, read some specific history variable and add it to a statistics table. Just as an example. Here, you would also like to do all in one transaction... and most probably also run into this issue.
Any feedback how to deal with it is really appreciated!
Thank you for costing time for this issue. Could you provide an testcase for this situation, it will help us to investigate this issue.