Locking mechanism on multiple sequential actions

We are looking for a way / mechanism to lock the definition instance during three operations:

  1. workflow modification
  2. variable change
  3. workflow migration

During this time, we like to prevent other users completing tasks (i.e the tasks should be blocked from the beginning of the "transaction of 1-3)

Is there a way doing so?

Hi @Gal_Cohen,

suspending the process definition should serve your purpose: https://docs.camunda.org/manual/7.14/user-guide/process-engine/process-engine-concepts/#suspend-process-definitions.

Hope this helps, Ingo

you find the button to supend in the upper left corner of the process definition view in cockpit:

I tried it before, and got the following error on modification:

It looks like “start before” modification type can not be executed on suspended definition instance. Is this the expected behaviour?

Hi @Gal_Cohen,

I think it’s expected:

Suspending a process definition disables it temporarily, i.e., it cannot be instantiated while it is suspended.

Maybe you should suspend only the process instance while you do your modifications?

Hope this helps, Ingo

Yep, I’m suspending the process instance and it returns 400. (’/process-instance/{instance_id}/suspended’)

Is there another way locking the instance?

Yes, this is expected and is how suspension is defined: Process Engine Concepts | docs.camunda.org

I don’t think there is a straightforward way to achieve what you want. An idea could be to set a variable before you want to make the changes. Then have a task listener on the complete event that throws an exception if the variable is set. Removed the variable after your changes are finished.

Cheers,
Thorben