Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Getting Table Ids and Protocol related data in Automation script

Solved1.19K views16th November 2023DataMiner LowCode protocol
0
Apurva Tandon [DevOps Advocate]1.61K 31st October 2023 0 Comments

Hi,
I want to retrieve the protocol related information and the table ids and names/description linked with the protocol in my automation script wherein I don’t know the Ids and Description
for example:


Scenario
:
I get protocol name from the selected device via parameter and then from there I want to get names and table ids as shown above related so that I can show it later in my application it will be helpful.


So from my Low code App as in above pic, once I click on that small gear I have protocol name, so from there I want to get all table ids and protocol related information as shown on top in my automation script in c#. There is no Dummy req. as I will get protocol info from clicking that row in table.

Showing list of resource types description and also for further functionality will be having table ids as well in order to get the further information for resources via GetTableDisplayKeys for the element selected. So, currently these are hardcoded but want them get the information automatically from Protocol.

Apurva Tandon [DevOps Advocate] Selected answer as best 16th November 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Robin Spruytte [SLC] [DevOps Advocate]647 Posted 3rd November 2023 2 Comments

Hello Apurva

With the following call, you can get a full definition of the protocol. This allows you to collect all table information.

var protocolInfo = engine.GetProtocolInfo(protocolName)    Method not available.

var protocolInfo = engine.GetUserConnection().GetProtocol(protocolName)

You can find the table parameters by looking for the correct parameter under the following property by either the table ID…

var tableParamInfoById = protocolInfo.Parameters.FirstOrDefault(param => param.ID == requestedTableId)

…or the name of the table

var tableParamInfoByDescription = protocolInfo.Parameters.FirstOrDefault(param => param.Description == requestedTableName)

Once you have the correct table parameter you can get all related column with

var columnParameters = tableParamInfo.TableColumnDefinitions;

This will allow you to find the parameter ID of each column, which you can then use again to find each param under protocolInfo.Parameters, in case you need additional info for that parameter, such as the description.

NOTE: Retrieving the protocol information is a big request on the system, so it is not advised to repeatedly do this. In case the automation script you mentioned will be executed very frequently, I would advise to implement additional caching to save previous results, instead of requesting it each time, otherwise performance issues might occur.

Caching can be done by using a static class, using a lock to avoid issues.

internal static class ProtocolInfoCache
{
private static readonly IDictionary<string, GetProtocolInfoResponseMessage> Cache = new ConcurrentDictionary<string, GetProtocolInfoResponseMessage>();

private static readonly object CacheLock = new object();

public static GetProtocolInfoResponseMessage GetCacheProtocol(IEngine engine, string name, string version)
{
lock (CacheLock)
{
string cacheKey = GetCacheKey(name, version);
if (Cache.ContainsKey(cacheKey))
{
return Cache[cacheKey];
}

return GetProtocolInfoFromDataMiner(engine, name, version);
}
}

private static string GetCacheKey(string name, string version)
{
return String.Join(“.”, name, version);
}

private static GetProtocolInfoResponseMessage GetProtocolInfoFromDataMiner(IEngine engine, string name, string version)
{
GetProtocolInfoResponseMessage response = engine.GetUserConnection().GetProtocol(name, version);
Cache.Add(new KeyValuePair<string, GetProtocolInfoResponseMessage>(GetCacheKey(name, version), response));
return response;
}
}

Apurva Tandon [DevOps Advocate] Selected answer as best 16th November 2023
Apurva Tandon [DevOps Advocate] commented 3rd November 2023

Thanks Robin for the answer,
but I cannot see engine.GetProtocolInfo(“”) method, i there any other Nuget package which I need to install.

Apart from this from the device can I get like this:
var ele = engine.FindElement(“OST-X20-DM-001”);
var val = ele.Protocol.AllParameters.Where(x=>x.ArrayType);

Hope this won’t be heavy call.

And yes, for caching is there any link related to that?

Robin Spruytte [SLC] [DevOps Advocate] commented 3rd November 2023

Apologies for the confusion. The GetProtocolInfo method is not available indeed. You can get a protocol via engine.GetUserConnection().GetProtocol(protocolName). But I believe the way you did it should lead you to the same result.

As for the caching. I added an example class to the answer.

0
Joshua Wong [SLC] [DevOps Enabler]436 Posted 2nd November 2023 1 Comment

Hi Apurva,

If you are intending to retrieve data from a table in a specific element, you could consider using the following methods, Method GetTableKeyMappings | DataMiner Docs together with Method GetTablePrimaryKeys | DataMiner Docs, to do so. Otherwise, if you are working with automation script dummies, you could also take a look at Class ScriptDummy | DataMiner Docs. I hope this is helpful.

Best Regards,

Joshua

Apurva Tandon [DevOps Advocate] Posted new comment 2nd November 2023
Apurva Tandon [DevOps Advocate] commented 2nd November 2023

I have updated the question, it is more clear now, wherein from the Protocol name I receive I want to get all related resource types such as S2X Input Ports, Demodulator etc, with table Ids in my automation script to get hat dropdown values filled.

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs