Hello All,
I’m working on a server script and I would like to know if there is a easy way to read agents to work with them inside a script, even in the spider or GF scripts, I think both can access agents in the same way, right?
I have one example here that works, However, I’m not sure that this is the best way to do it.
// Perform a read on agents DataElement sol1 = DataElementEngine.NewDataElement("Adroit.Test.value"); DataElementCollection dec = DataElementEngine.NewDataElementCollection(); dec.Add(sol1); MethodReturnInfo info = MyConnection.ReadDataElements(dec); DataElementCollection collectionReturned = info.ReturnObject as DataElementCollection; foreach (DataElement de in collectionReturned.Values) { if (Convert.ToInt32(de.Value) > 280) { result = true; } else { }
Sometimes is only needed to check one agent and I made it using this whole code like the example.
Regards,