We are trying to retrieve all elements hosted on the same DMA as the one where our script is running.
Currently, we use the following approach with the core DMS class library:
dms.GetElements().Where(e => e.Host == thisAgent);
We are considering replacing this with:
dms.GetAgent(thisDma).GetElements();
Internally, this method sends the following SLNet message:
GetInfoMessage message = new GetInfoMessage
{
Type = InfoType.ElementInfo,
DataMinerID = this.Id,
};
Question:
Does GetAgent(id).GetElements() also return elements that were originally created on a different DMA but later migrated to the current DMA? Or does it only return elements whose originating DMA matches?
Hi Tom,
Not familiar with the core DMS class library implementation but the raw GetInfoMessage for ElementInfo will always return all elements in the DMS, regardless of who hosts what.
DataMinerId here will only be used for routing, it refers to which agent will answer the request.