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,
I believe there is a way to verify if an element is startup is done completely.
1. Subscribe on the ElementStateEventMessage for each element.
This can be done by creating a subscription with filter 'SubscriptionFilterElement' (for each element).
2. The event message contains 2 properties that you need, the State property and IsElementStartupComplete property.
3. If State is 'Active' + the IsElementStartupComplete property is true, then the correspondent element is ready.
Hope this helps you further
Thanks Matthias, this is a good idea testing the IsElementStartupComplete property, which as Jarno noted, is available through the method IDmsElement.IsStartupComplete()