How to end a process, when the new one started

Hi guys,

I have a question, maybe someone of you will give me some tips. So, let say I have a Workflow named “Start”.
This WF starts and reaches a UserTask for example and waits there someone to interact with the user task.
In the same moment the WF “Start” starts again.
Now, I want when the new WF “Start” started, the previous one that is waiting on the UserTask to kill it, i.e to end it, without someone to interact with the user task.

I thought to do that witht a MessageEvent and it is working, where I put the UserTask in a Sub Process… but is there a better way to do that?

Is this task specific or do you only want one instance of the process running at any one one?

Hi Nial,
I would say it is spacific… I don’t want the previous instance to be killed at any moment of the time, only if the previous instance is at this spot where the UserTask is.
In some other cases, it can happen that the previous instance go forward with the process and a new instance is started (before the previous one reaches the end). This should not be affected, by starting a new instance.

Anyone with any idea?

Hi @DeniVele

A signal event at the beginning would do the trick - but make sure it correlates with some kind of key specific to the process that you want to stop - by default it will stop ALL instances that are on that task.

2 Likes

Is that possible? can we enforce that a single instance of the workflow runs, and the other instance starts ONLY after first one is completed?

Sure, you can build a queue mechanism if you like to ensure that all started instances will wait until the currently running instance has completed.

The example i posted above will actually stop any instances that started earlier than the current one - assuming they’re working on that particular user task.

Thanks Niall,
The magic does work!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.