Recreate Task

Hi everybody…

I have a process that has something like this:

21

Basically, the processes creates two parallel “threads” and the second one has a condition that leads it to the end or returns to itself.

Due a bug in one version of this process, some instances mistakenly ended thread 2 when they should come back to the task.

The question is: is there any way to recreate the task on thread2 to fix these instances, preferably using rest services?

Hi @fcordova
Have a look at below link…
https://docs.camunda.org/manual/7.6/user-guide/process-engine/process-engine-concepts/#start-a-process-instance-at-any-set-of-activities

1 Like

You could get the variable data from the history API. Then start new instances and have them start on the thread two task?

Hi @hassang and @StephenOTT… Thanks for your prompt reply…

Let me se if I understand…

In this scenario, I should collect all the variable in all concurrent threads (since every one has its own contexts, loopCounters, etc) and rebuild it all in a new instance to replace the old one ?

I don’t think I could do that… the diagram above is a very simplified version of the process which actually has also some multi-instance subprocesses…

But if this is not possible, would it be too risky if I created a new instance and tried to hack this specific activity (I mean, changing something in the database, maybe) and move it to the old instance ?

You are free to try what you like, but I strongly recommend against that. Try to stick to the API.

I understand and I’d really think more than twice before trying it… :slight_smile:

but as far as I understand, the API won’t help, right ?

Is it too heretic to think in a method in the API where I could start an activity of a specific activity in a running instance ? I mean, I understand it should not be used regularly but could really help in situations like this one.