AnsweredAssumed Answered

Locking an instance to update variables

Question asked by franck102 on Aug 21, 2014
Latest reply on Aug 30, 2014 by jbarrez
Hi all,

We are building a complex product around the Activiti 5.15.1 engine and we occasionally need a background process to update the values of process variables in running processes (namely replacing a given URL stored in String variables with another one).
We don't control the process design (those are authored by our customers) so we need to do this through the Activiti APIs.

I am looking for a way to "pause" the process to perform the update, to avoid any race condition in particular with service tasks that may be using the variables. It seems like I would need to make sure that no job is currently active, then to prevent the engine from picking any new job or from performing any command while the update is under way… but looking into the APIs this seems far from straightforward.

Another approach I was thinking of would consist in creating a custom, exclusive update job on the fly and scheduling it - the idea being that the engine would pick it up and execute it.

Has anyone achieved something similar before? Any suggestions as to what the right design would be?

Thanks in advance!