Hi,
I'm writing an automation where I need to start a given set of elements that are stopped.
The script needs to wait until all the elements are effectively up and running and not just we triggered their start.
On a first approach, I'm testing the IsActive property but I believe it gets 'true' as soon as we call Start(), thus the method below does not really do what we want.
Do you have any ideas on how to achieve this from my automation script?
ps: the logic for the stopping case will also be requierd, i.e., to wait for all the elements that I called Stop(), are really stopped.
private bool IsAllStarted(Element[] elems)
{
foreach (Element el in elems)
{
if (!engine.FindElement(el.DmaId, el.ElementId).IsActive)
return false;
}
return true;
}
Hi Paulo,
Although the approach of Matthias might work, it uses an SLNET call so we should be cautious when using these. Another option that might be worth mentioning is using the following method Method IsStartupComplete | DataMiner Docs, part of the Skyline.DataMiner.Core.DataMinerSystem namespace (available through a NuGet package).
Kind Regards,
Jarno
To complement Jarno’s answer, which I believe it’s the correct approach; IsStartupComplete method is a wrapper for a specific call and you can find additional information about it here: https://docs.dataminer.services/develop/api/NotifyTypes/NT_ELEMENT_STARTUP_COMPLETE.html