Hi Dojo,
On our DMS we have lots of Enhanced Services, but there isn't an option to change the state of the Enhanced Service from the Hamburger Menu (Activate/Pause/Stop/Restart)
What is an easy way to restart these Enhanced Services?
Thanks
Hi Dave,
First of all, my question to you would be: why do you want to force restart an enhanced service element? Is there no other way to 'reload' items by triggering a flow on this service element instead rather then restarting? (feel free to comment).
I know you are an experienced man, so if you have a valid reason to restart or control the state of the enhanced service element, follow along with my suggestion here to use the automation-script module. In the end an enhanced service has a "hidden element" attached on the back. So via code you can get hold of the element and perform your required action.
Disclaimer: Please be careful with what you do to avoid bring your service in a stuck state. if you have doubts, please reach out to Skyline first advise on architecture & approach.
Recently we also faced a situation where we wanted to give a restart to an enhanced service element.
We created following Automation script code for it:
text based for easier copying:
string serviceName = "ThisIsMyEnhancedServiceName";
IDms dms = engine.GetDms();
IDma agent = dms.GetAgents().FirstOrDefault();
var element = agent.GetElement(serviceName);
element.Restart();
Following NuGet and usings are required:
NuGet: Skyline.DataMiner.Core.DataMinerSystem.Automation
using Skyline.DataMiner.Core.DataMinerSystem.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Common;
Hope that helps you out, please do share a bit more on the context on why you want to control the state of this service element. Maybe we can also share alternatives that suit your case even better.
KR, Thijs
Thanks for your answer Thijs – we have indeed gone down the road of having a script to restart the Enhanced Service. We certainly have had the situation where we have had to restart the Enhanced service to re-pull data from other Elements.
I was wondering, is there a specific reason that there isn't the option to change state via the Hamburger Menu, or is it more of a legacy reason because they are Services, even though they also behave as Elements?
Hi Dave, I can imagine such feature would maybe open up other corner-cases or confusion, as normally services should not need "restart" options. In most of the situations there are typically better ways that you can develop the enhanced element to force refresh data by for example a button interaction or workflows being triggered via InterApp-calls or script interactions etc.
I'm happy to read that you managed to use the sample to work-around the case via automation-scripting. If you have a clear need for a feature as such, then you can either motivate a feature suggestion here on Dojo (see the "More" section), or reach out to your Technical contact person at Skyline to further expand on the use-case.
If you have no further questions or remarks, feel free to mark this question as "Answered". Thanks!
And to make the cycle complete, This script could feed the "servicename" in via a script-parameter. That way you could create your own "control buttons" on the Visual overview of your service, launching this control script to execute the expected state action.