How can I get the list of all protocols in c# and show them in the low code app in dropdown as adhoc-data source?
As in GQI I cannot see any way like engine.GetUserConnection().GetProtocols?
I can see I can get protocols all from Low code app directly, but how can I adjust to bring only names from Query?
It's indeed currently not very straightforward to use the DMS classes in a GQI data source. The trick is to create a class that implements the ICommunication interface. This can be found here.
The 'GqiDmsConnection' class can then be used as follows:
public OnInitOutputArgs OnInit(OnInitInputArgs args)
var connection = new GqiDmsConnection(args.DMS);
var dms = DmsFactory.CreateDms(connection);
var protocols = dms.GetProtocols();
return new OnInitOutputArgs();
You could leverage the DMS callback that allows you to send any SLNet message (see docs). This callback can be used to retrieve all elements using the 'GetLiteElementInfo' message. These 'LiteElementInfoEvent' responses can then be used to get a list of protocols from them. (This is the way used by our dashboards)
private HashSet<string> GetProtocols()
var message = new GetLiteElementInfo()
ExcludeSubViews = false,
ViewID = -1,
IncludeHidden = false,
IncludePaused = true,
IncludeStopped = true
var elementInfos = _dms.SendMessages(message).OfType<LiteElementInfoEvent>();
var protocols = new HashSet<string>();
foreach(var elementInfo in elementInfos)
if (protocols.Contains(elementInfo.Protocol)) continue;
My example only retrieves the protocol names, but you can also get the protocol type, protocol version, ... from these responses.
The retrieved protocols can then be returned as rows by your ad hoc source (see docs).
An other option is to use the same callback with an 'GetInfoMessage' to retrieve all protocols.