Question
· Sep 16, 2021

how to restart connector/list of connector using another code (so by code) or terminal with a batch

Hello everyone,

 

I think I put everything in the title. It's a simple question : how to restart a connector or a list connector without double-clicking?

Is there a way using another connector to do so (using code)?

Is there a way using a command line in the terminator/ds command (in the purpose to use a batch)?

 

Faithfully,

Thomas

Product version: HealthShare 2020.1
Discussion (4)1
Log in or sign up to continue

Hey Thomas.

EnableConfigItem from Ens.Director should be what you're looking for. You will need to call it twice (once to stop, and a second time to start it again).

From Terminal:

Do ##class(Ens.Director).EnableConfigItem("ConfigNameHere", 0, 1)

Do ##class(Ens.Director).EnableConfigItem("ConfigNameHere", 1, 1)

It returns a status, so you may want to evaluate the status when stopping it to ensure it stopped before trying to start it again, or report an error if it fails to stop or start.