Not thread safe TaskCompletion-Class

Hello jmix-Team,

we encountered following behavior of the bpm-addon:

While within a concurrent user setting, processes variables (PV) were carried over from process instance (PI) to the next process instance. This happend between two, totally unrelated, process definitions (PD).

Example:
PD 1 declares two PV’s A and B.
PD 2 declared also two PV’s B and C (both PI’s sharing the same name of a variable is a coincidence).
PI 1 from PD 1 is created and both variables are declared.
If one creates a new PI 2 from PD 2 with the PV’s B and C, PI 2 now got in total 3 process variables A, B and C.
Furthermore PI 1 also got enriched with process variable C from PI 2.
Both PV’s of both PI´s still got the initially declared value of B.

Please excuse me, a more detailed version or minimal reproducible code cannot be provided since we’re dealing with critical financial data.

So, from what we can tell, the error happens while dealing with the processFormContext (Jmix Screen :: Jmix Documentation). When we’re calling the taskCompletion-method on the processFormContext, the variables from a different screen fragment are carried over. The TaskCompletion-Class is not scoped as Prototype but rather as Singleton.
Therefore, in its current state, it’s not thread-safe.

1 Like

Hi,

You’re right, it’s a bug.

I’ve created an issue. Thank you for reporting a problem.