[BPT] How to terminate all open processes

[BPT] How to terminate all open processes

  
Hey everyone.

I have a BPT process that has gone awry and I need to terminate all open instances of it. Going to each of the 1500+ instances manually is not gonna work, because it's just too much.

Is there any way to bulk terminate them all?

And don't worry, this is a development environment :p

Thanks!
Hi Carlos,

Idk how exactly terminate a process in execution, but I think you can achieve this by using the Process API or  BPT API of the platform.

Maybe this link can be a start point:
http://www.outsystems.com/forums/discussion/10624/bpt-new-api-for-deleting-archiving-processes/

Hope it helps.

Maybe you could publish the eSpace that holds the BPT process but without the processes? Iirc that should close everything that's open.
Thanks for the help.

We ended up just mass-updating the Processes table with the Terminated status and that fixed it. No more rogue processes.

Kilian Hekhuis wrote:

Maybe you could publish the eSpace that holds the BPT process but without the processes? Iirc that should close everything that's open.

Unfortunately it does not. If you re-publish with the process added back again, the error state processes reappear.



If you're willing to take a risk hurting yourself you can delete the processes directly from the Process table. The database table name is ossys_BPM_Process. You can find the process_def_id from the url in Service Center /ServiceCenter/Process_Details.aspx?Index=0&ProcessDefId=38  <-- that's your process_def_id, in this case 38.

then 

I found I needed to republish my module with the process to get it to start running again.

You can find the entities behind the process flows in the 


Hi PJ M,

Although your solution may work, it is risky to mess with System entities, and it will stop you from using the process execution information to understand what went wrong and what was actually executed (and you may be interested in rolling that back).

Hi PJ M 

We have been doing that a few times and it does work. However, as Jorge rightly points out, this is not ideal.

This approach we only took a few times when our server became unusable due to high process load or rapid failure in a process spawning thousands of new processes.

Our discipline has always been to figure out and fix the problems identified and prevent us from having to use this mass terminate approach. We have also attempted to adhere to the best practices as closely as we possibly could when designing timers and processes.

I did hurt myself with this. Found some code that was loading processes by id and those records were deleted, so some null pointers were thrown. After the first DELETE of those processes, I decided to update them to Closed or Terminated status and that may be better, but I haven't tested it specifically.

We need a terminate all or something on the Processes tab. It's just too much to see 99+ in the task box all the time, the user never knows if they actually have something to do and it's easy to create processes that create processes, so we need a way to clean up our dev environment without having to go through backdoors or click links hundreds of times.

Solution


Hi PJ M

Best approach to do something like you want is build a small piece of code using the System action ProcessTerminate. This way you will ensure system data consistency.

Solution

There we go! That is what we are after!  Thank you so much, Nuno!!