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

Automation – Iterate through rows

Solved784 views3rd June 2024Automation
3
James Stokell [DevOps Advocate]493 30th May 2024 0 Comments

I was wondering if you'd be able to give me some guidance on whether what I want to achieve is possible in automation without having to write any C# code...

I want to make two scripts;

  1. One which is given a neuron element name, and iterates through every row in a given table, and changes a parameter in that table to 'Enabled' (which resets a counter).
  2. Another script which gets every element in a given 'View', and feeds them to the above script, so that I can run the above script on all neurons in a given view.  P.S. I want to make two separate scripts so that I can either run this on a single neuron, or all of them.

Thanks, James.

James Stokell [DevOps Advocate] Selected answer as best 3rd June 2024

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Thijs Vanovenacker [SLC] [DevOps Advocate]2.21K Posted 2nd June 2024 2 Comments

Hi James,
You will have to use C# for this, but luckily there are already plenty of things to support you with to make it as easy as possible! 🚤

I would suggest you create a new automation script by using Visual Studio and our DIS plugin.
You can easily create a new project solution of type "DataMiner Automation"

If you need some extra help on this? Please take a look at our Automation training course. In specific following topic: Creating automation scripts using DataMiner Integration Studio (DIS) - DataMiner Dojo

To help you out for your specific use-case: (script 1) set values on rows of a table:

Simply adding the "neuron element" placeholder as an input under  "protocols" on the script xml inside the solution. (example below)

In this solution there will already be a C# script block by default. Inside the "RunSafe()" method you can start adding your lines of code to represent your workflow in a simple manner.

I created a quick sample for what you try to achieve below.
Note that all "parameter IDs" and "newValue" are fictional of course.

var neuronElement = engine.GetDummy("Neuron Element");
var primaryKeys = neuronElement.GetTablePrimaryKeys(1000/*table ID of the given table*/);

object newValue = 1 /*Enabled*/;
foreach (var pk in primaryKeys)
{
    neuronElement.SetParameterByPrimaryKey(1210 /*write parameter ID of table column to set*/, pk, newValue);
}

Regarding the second script, you can easily find elements from a certain view by using "engine.FindElementsInView()"

Below example shows how you could gather elements from a specific view, iterate them, and for the elements that match the expected protocolname, run the subscript.

var elements = engine.FindElementsInView("Neuron overview");

foreach (var element in elements)
{
if (!element.ProtocolName.Equals("NEURON PROTOCOLNAME"))
{
continue;
}

// prepare a subscript
SubScriptOptions subscript = engine.PrepareSubScript("Neuron Reset Counters");

// link the main script dummies to the subscript
subscript.SelectDummy("Neuron Element", element);

// set some more options
subscript.Synchronous = false;
subscript.LockElements = true;

// launch the script
subscript.StartScript();
}

note that if you plan on doing this frequently, still consider combining both scripts into one. Depending on the number of expected subscript runs.

The examples I made above are all using methods that are directly available on top of the IEngine object. For more advanced interactions with DataMiner objects from within automation module, We would recommend you to approach this via the iDMS class library features that are available via following nuget: NuGet Gallery | Skyline.DataMiner.Core.DataMinerSystem.Automation 1.1.1.11

Once the nuget has been added to your solution, you can start to consume it by following this docs pages: Class library introduction | DataMiner Docs

Hope this helped you out! let us know if you need anything more!
Have fun! 🙌

Thijs Vanovenacker [SLC] [DevOps Advocate] Posted new comment 3rd June 2024
James Stokell [DevOps Advocate] commented 3rd June 2024

Thanks Thijs.

I was mostly trying to avoid C# as I don’t have a Visual Studio license, but if that’s the only solution to my requirement then I’ll look to get one, thanks!

James.

Thijs Vanovenacker [SLC] [DevOps Advocate] commented 3rd June 2024

Hi James,
Good to hear! Have fun with Visual Studio and the world of coding!
I’m sure this will open new DataMiner opportunities and challenges for you to tackle. Reach out if you need any help!

You are viewing 1 out of 2 answers, click here to view all answers.
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

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin