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

SetParameter method output issues

Solved1.33K views19th July 2023Automation script SetParameter
1
A B M Sidddique [DevOps Advocate]371 27th June 2023 0 Comments

Hello ,
I have been trying to use the SetParamerter method in the script class to trigger a specific component of an element that has been found by the correlation rule filters.My full automation script is fully functioning but breaks in the SetParameter line ( used print statement and exceptions for checking).I believe I am having issues with the parameters used inside the () of the method.


I have tried out both SetParameter and SetParameterByPrimaryKey , using the parameterId,primaryKey,object value and IDx (depending on the method).
From my understanding of the primary key , it is unique for each component in an element ,so usually it should be hardcoded with exact value/string. But using my script , I wanted to dynamically initialize the parameter or put a part of the full string which will help to identify the exact position of the cell in the components list of the element. Could anyone please guide through where I am going wrong.

The error message:
An error occurred while setting the parameter: Set Parameter (‘_117620_1711’:10140/) Failed: 0x80004005 (Script ‘Failure Alarm’)”

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 19th July 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Emmanuel Dal [SLC] [DevOps Member]4.63K Posted 27th June 2023 4 Comments

Hi,

When the button is in a table, you need to provide the exact key to the SetParameter method.

In case your script does not know the exact value of the key, you can use GeTablePrimaryKeys/GetTableDisplayKeys to get the entire list of keys that are part of the table. Then, try to identify the key that you need and use it in the SetParameter method.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 19th July 2023
A B M Sidddique [DevOps Advocate] commented 27th June 2023

will there be a difference if i used setParameterByPrimaryKey or just SetParameter , I know the display key ( which is a better verification parameter for my case)

A B M Sidddique [DevOps Advocate] commented 27th June 2023

I want to dynamically initialize the primary key if possible, so i can feed different elements with the same parameter ID in the same driver

Emmanuel Dal [SLC] [DevOps Member] commented 28th June 2023

Just use SetParameter and it will work well (FYI, SetParameter accepts both index and display key of a table, while SetParameterByPrimaryKey will only accept the index).

I’m not sure to understand what you want to do. Do you want to use same script for different elements and therefore performing SET actions on rows having different keys , and passing the key as input argument ?
If that’s the case, then you need to extend your script with Parameters ( https://docs.dataminer.services/user-guide/Advanced_Modules/Automation_module/Designing_Automation_scripts/Script_variables.html#creating-a-parameter) , and retrieve the value of the parameter in your script ( https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Automation.Engine.GetScriptParam.html )

A B M Sidddique [DevOps Advocate] commented 28th June 2023

I have created a correlation rule with specific alarm properties , and executes a specific automation script (This one) every time those alarms are detected. Upon detection and parsing of required information, it has a restart button in the component section which needs to be triggered by the SetParameter.So yes the same script will be used to dynamically find all elements affected by the alarm and execute the action on the specific component.

2
Amer Hodzic [DevOps Member]774 Posted 28th June 2023 6 Comments

If your trying to trigger a button you will need this: element.setParameter(10140,1);

try this in your code first

if it is in a Table then it would be element.setParameter(10140, *key value here * , 1);

Amer Hodzic [DevOps Member] Edited comment 28th June 2023
A B M Sidddique [DevOps Advocate] commented 28th June 2023

what would be the key value – the primary key , display key or the value of column cell/button intended to be trigger

Amer Hodzic [DevOps Member] commented 28th June 2023

The Display key of the row

Amer Hodzic [DevOps Member] commented 28th June 2023

If you want to use primary key it would be element.SetParameterByPrimaryKey(10140, PrimaryKey, 1);

A B M Sidddique [DevOps Advocate] commented 28th June 2023

I tired both methods and the SetByPrimaryKey is the only one that works but it would not be ideal for me to use the primary key as it is unique for individual parameter and hence If I declare that exact string it will not allow me to catch other element alarms and trigger the button. When I use SetParameter the exception catches it

Amer Hodzic [DevOps Member] commented 28th June 2023

Ah I see well it depends how and what should trigger the Restart as for my automation project I use different elements and made a loop to get the Primarykey value for the able than loop again for specific value I need and than that becomes the primary key I will use.

key = elem.GetTablePrimaryKeys(14600);
string[] temp = ip_Name.Split(‘.’);
foreach (string s in key)
{
if (!string.IsNullOrEmpty(s))
{
controller.Engine.Log(elem.GetParameterDisplayByPrimaryKey(14616, s));
if (elem.GetParameterDisplayByPrimaryKey(14616, s) == “Not initialized” || elem.GetParameterDisplayByPrimaryKey(14616, s) == “(not initialized)”)
{
}
else
{
out_port_int.Add(Int32.Parse(elem.GetParameterDisplayByPrimaryKey(14616, s)));
}
}
}

int[] port_collection = out_port_int.ToArray();
int max = port_collection.Max();
int last_value = port_collection.Length;
controller.Engine.Log(“Make to assign value:” + max);
port = max + 1;

Show 1 more comments
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