Question
chenna velagala · Feb 18

Can I get currently running Jobs on a particular business host and hold them in a variable

I am working on automating to pick all the jobs running particular business process and kill them by using a routine. Though I was able to kill the jobs/PID on server by using (sudo kill jobid) and by using do $SYSTEM.Process.Terminate(jobid) or  Do ##class(Ens.Job).UnRegister("buseiness host"jobid), I am looking to build a routine by setting a variable with all the business process names and then fetch the jobid or PID associated with those business process and kill them. Any help is highly appreciated.

Product version: HealthShare 2017.2
$ZV: 70626DDA-3A37-11E5-A37C-5056AB681A00
00
1 0 3 84
Log in or sign up to continue

Why do you want to kill all BH jobs directly?

You can just disable a BH and it would effectively do the same:

set sc = ##class(Ens.Director).EnableConfigItem(BH, 0)

Lebedyuk - We have to disable jobs/PID before disabling the BH as we are querying database. If you are still suggest that disbaling BH without killing jobs will not have any imapct let me know.

FYI-  I am invoking above class for enabling and disabling BH.

Disabling BH gracefully shutdowns all BH jobs.