Hi Team,
I'm trying to check if an element is active or not using dms send message in adhoc GQI.
Is it possible to get that info?
Thanks
Hi, if the method proposed by Miguel doesn't work in your case, you could use GetElementByIDMessage or GetElementByNameMessage in your ad-hoc data source to retrieve the information.
var elementInfo = dms.SendMessage(new GetElementByIDMessage(agentID, elementID)) as ElementInfoEventMessage;
var isActive = elementInfo.State == ElementState.Active;
The dms object can be retrieved in the OnInit() method:
public OnInitOutputArgs OnInit(OnInitInputArgs args)
{
dms = args.DMS;
return new OnInitOutputArgs();
}
Hi Hari,
Is it not an option to use the default data source Get Elements to retrieve the state of an element? You can perform an inner join between the result of the ad-hoc data source and the result of 'Get Elements' to get the element state.
Hope it helps.
Hi Miguel,
Thanks for the response. Actually i'm trying to get the elements inside each service and check if all the elements in that service is active or not cumulatively. For which i'm writing custom data source. So do we have any method which gives us the state of elements in a custom GQI using dms send message