Hi Dojo Community,
I try to extract port info with the following line in an automation script.
-----
GetLiteElementInfo glei = new GetLiteElementInfo();
glei.DataMinerID = element.DmaId;
glei.ElementID = element.ElementId;
LiteElementInfoEvent leie = Engine.SLNet.SendSingleResponseMessage(glei) as LiteElementInfoEvent;
ElementPortInfo[] PortInfo = leie.PortInfo;
-----
When the element is started it works well but when the element is paused or stopped, I have the following exception
Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Script.Run(Engine engine) (Script 'Update community string property per protocol v2')
How can I have retrieve the info even if the element is not started?
Thank you for your help
Hi Yvan,
The GetLiteElementInfo SLNet message contains 2 boolean properties that you need to set to true in order to be able to retrieve stopped (IncludeStopped) or paused (IncludePaused) elements.
Your request would look something like this:
GetLiteElementInfo glei = new GetLiteElementInfo();
glei.DataMinerID = element.DmaId;
glei.ElementID = element.ElementId;
glei.IncludePaused = true;
glei.IncludeStopped = true;
Great. It works now.
Thanks for the answer. It’s like ElementFilter.