Via code I would need to find the resource on a system based on a DVE that represents the equipment.
For example I have a Main Element using the iControl connector. This element generates a DVE per output (iControl.EXT-A, iControl.EXT-B ...)
For each of these outputs a (function)resource is created on the system.
Via an automation script, I now need to find this function resource starting from the (equipment) DVE dmaId/elementId
Can you please share me a code example?
Both DVE Name and the Resource ID are stored in the [Generic DVE table]; therefore you should be able to access resource Id from DVE name using data available in that table.
Alternative is to use the ResourceManagerHelper and an appropriate filter:
FilterElement<Resource> filter = ResourceExposers.DmaID.Equal(fctDve.DmaId).AND(ResourceExposers.ElementID.Equal(fctDve.ElementId));
var fctResource = RMHelper.GetResources(filter).OfType<FunctionResource>().First();