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


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:

    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