In an Automation Script I need to find a primary (or display) key based on the value in another column of the table. The table currently has approximately 5800 rows, so doing a GetTablePrimaryKeys() then iterating through each row to check the other column is slow and resource intensive.
Is there an unpublished C# Element method that I can use to either retrieve the entire table or primary key and one other column as an array?
Thanks!
Hi Jim,
You could use the DataMiner class library to retrieve the full table for a specific element. Please see below example:
// Create a DMS object
IDms dms = engine.GetDms();// Get the element based on element name
IDmsElement dmsElement = dms.GetElement("My Element Name");// Get table with PID = 1000
IDmsTable dmsTable = dmsElement.GetTable(1000);// Parse information from table
...
Reference:
Hi Jim,
In Dojo there is a free course about DataMiner Automation.
https://community.dataminer.services/courses/dataminer-automation/
In the Advance level, you can find two topics:
– ‘Creating Automation scripts using DataMiner Integration Studio (DIS)’: This topic will show you how to create an automation script using DIS (required to use the class library)
– ‘DataMiner Integration Studio (DIS) Class library’: This topic will show you how to use the class library. The video explains a use case where an automation script needs to communicate with an element. However, for your specific use case, starting from minute 04:20 you will find a small explanation about the ‘Get DMS snippet’ (this method is used in the example)
Please let me know if you need additional information
Unfortunately I do not have access to DIS so the Class Library is not helpful to me. Unless you have any other suggestions I will consider the answer to be that it is not possible given our current situation.
Hi Jim,
I am afraid that without the class library, it will not be possible to implement the methods described in the example. Maybe you could check with the squad assigned to your account for possible alternatives
Hi Miguel,
Thanks for the answer, this is exactly what I’m looking for. However I’m having some namespace issues incorporating it in to an automation script. Can you specify the correct DLL reference and include directives?
When I try to include the namespace below it is not found, and I can’t find the referenced DLL anywhere on our DMA. We are running version 10.1.12.0-11129
Namespace: Skyline.DataMiner.Library.Common
Assembly: DataMiner System Interfaces (in DataMiner System Interfaces.dll) Version: 1.0.0.0 (1.0.0.0)
Thanks!