Question
· Dec 28, 2017

How to restart particular item in Business service or BP or BO in Ensemble?

I have many items in business services.

one of my particular business service is frequently asking restart.

Is there any code to update particular business services out of all services?

 

Thanks in advance...

Discussion (2)0
Log in or sign up to continue

You can add Ens.ProductionMonitorService service to your production, which provides a monitor service for the production status

The default behavior of this service is to call UpdateProduction once it notices the production is not up-to-date. Users can override the OnProcessInput method to customize the behavior. It would be enough to automatically restart relevant items and keep production up to date.  

Generally to access/manipulate info about Ensemble and it's hosts use Ens.Director class, i.e. UpdateProduction method.

Here's a routine I use to restart a particular host in the production:

RestartEnsHost(pName)
    set tSC = ##class(Ens.Director).EnableConfigItem(pName,0) if 'tSC write !, $system.Status.GetOneErrorText(tSC), !! quit
    set tSC = ##class(Ens.Director).EnableConfigItem(pName,1) if 'tSC write !, $system.Status.GetOneErrorText(tSC), !! quit
    quit