Ending a call activity by moving an execution to the end node

Hi everyone,
Thorben helped me recently with writing a replace-execution command. That worked great. Thanks again!!

But by playing around with process instance modification, I found a general problem with them, i.e. moving an execution/activityInstance/transitionInstance to an end event. For instance let’s assume I called an call activity and have a problem in there. I want to change some variables by hand an then move the execution to the end event of the call activity to jump back to my main process. Since a move is always a start of a new execution followed by a cancellation of an execution, I must first start a new execution on the end event. That does not what I hope for. I get a new parent execution and below it a new execution on the end event. Then the latter is ended by the end event and the root execution is also ended/cancelled. The process that called the call activity remains the same and I’m back to square one.

Any idea of how to handle this. I only find solutions that forbid moving to end events. I could either model a dummy branch into my sub-process with a dummy intermediate catching event, where I can move my execution and then trigger the event after the move has succeeded. That’s pretty ugly!! Or I could in general forbid to move to end events.

Best, Peter

Hi Peter,

You can reverse the order of the modification instructions in Cockpit before you submit them. That should do the trick in thise case.

Cheers,
Thorben

Hi Thorben,
that actually works pretty nice. I thought that performing the cancel first, kills the process instance before I can start a new execution. So does that always work? If I have a process with a single execution and I use the modifications to move the execution to some other node (not an end event), can I then still first cancel this sole execution and then start and new one within the same modification command? Or does than only, for some strange reasons, work if I move the execution to an end event?

Hi Peter,

See the following docs section on this topic: https://docs.camunda.org/manual/7.7/user-guide/process-engine/process-instance-modification/#cancelation-propagation

Cheers,
Thorben

RTFM. Sorry, I read all of this at some time, but it seems I should have read it again.
Now I need to find out, how I can put that nicely in my replace-execution command.
Thanks again, Peter