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
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • 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
    • Tutorials
    • 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
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • 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
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How can script variables be handled without operator interaction?

575 views8th January 2025Automation script MemoryFile Scheduler Task session variables
4
Daniel Zank [DevOps Advocate]208 3rd January 2025 0 Comments

Hi all!

I have a question on script variables. In the documentation it is explained that:

"Prior to running a script, operators will first have to link the dummies and parameters to actual elements and values in the DMS. Therefore, it is best to give the variables a meaningful name the operators will be able to work with."

Is there any way that this operator interaction is not necessary? The background is that we would like to execute a script via a task in the scheduler, which has a changing value from a memory file for the parameter.

Best regards and thank you in advance for your inspiring answers!

Daniel

Daniel Zank [DevOps Advocate] Answered question 8th January 2025

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Miguel Obregon [SLC] [DevOps Catalyst]18.56K Posted 3rd January 2025 1 Comment

Hi Daniel,

If I understood correctly, you have a memory file defined in the Automation module, and you are using this memory file for your script parameter:

If this is the case, when configuring a scheduled task, the user will need to choose one of the possible values from the memory file:

To avoid this, for example you could remove the script parameter and process the memory file directly in a C# script block. The method GetMemory allows you process the content of a memory file.

Hope it helps.

Daniel Zank [DevOps Advocate] Posted new comment 8th January 2025
Daniel Zank [DevOps Advocate] commented 8th January 2025

Hi Miguel, thanks for your answer and the inspiration! I hope I'm on the right track with my script. But now I have the problem that the variable in the view cannot be updated by the script. Please see my additional answer.

2
José Silva [SLC] [DevOps Catalyst]1.32K Posted 3rd January 2025 1 Comment

Hi Daniel,

You might consider designing the script to dynamically retrieve the necessary information (e.g., from a file or memory location) rather than relying on input parameters.

This approach can reduce manual input while still providing the flexibility you need for your use case.

Let me know if this is not possible for your use case. I can try to thing in another solution.
Kind regards,

Daniel Zank [DevOps Advocate] Posted new comment 8th January 2025
Daniel Zank [DevOps Advocate] commented 8th January 2025

Hi José, thanks for your answer and the inspiration! I hope I'm on the right track with my script. But now I have the problem that the variable in the view cannot be updated by the script. Please see my addition answer.

0
Daniel Zank [DevOps Advocate]208 Posted 8th January 2025 0 Comments

Hi José,

Hi Miguel,

thanks for your help, I think to be on the rigth path for a solution.

But now I have the problem to update the variable in my view with the memory file value.

And the second point: I still have to add a memory file dummy(?) on the automation script, to use the "GetMemory" method. Is there any way to call the memory file directly from the C# script? If I don't create a dummy, the memory file is not found.

using System;
using System.IO;
using Skyline.DataMiner.Net;
using Skyline.DataMiner.Net.Exceptions;
using Skyline.DataMiner.Net.AutomationUI;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;

public class Script
{
public void Run(Engine engine)
{
engine.Log("Before Memory Load");
ScriptMemory memory = engine.GetMemory("Annotations");

if (memory == null)
{
engine.Log("Memory file 'Annotations' not found.");
return;
}
else
{
engine.Log("Memory file 'Annotations' was loaded successfully.");
}

engine.Log("After Memory Load");

/*
// Speichern von Werten mit aufsteigenden Adressen als Schlüssel
for (int address = 0; address < 1; address++)
{
memory.Set(address, $"Wert an Adresse {address}");
}*/

// Auslesen und Anzeigen der Werte
for (int address = 0; address < 1; address++)
{
try
{
engine.Log("Text vor Get Value on address: ");
object rawValue = memory.Get(address);
if (rawValue == null)
{
engine.Log($"Address {address}: No value found");
}
else
{
string value = rawValue as string;
if (value != null)
{
engine.Log($"Address {address}: {value}");
engine.Log("Text nach Get Value on address: ");
}
else
{
engine.Log($"Adress {address}: Value is not a string (Typ: {rawValue.GetType().Name})");
}
}
}
catch (Exception ex)
{
engine.Log($"Error accessing address {address}: {ex.Message}");
}
}

// Aktualisieren der Visual Overview
UpdateVisualOverview(engine, memory);
}

private void UpdateVisualOverview(Engine engine, ScriptMemory memory)
{
// Annahme: Es gibt einen Parameter in der Visual Overview für jede Adresse
for (int address = 0; address < 1; address++)
{
engine.Log("Befor Visual Overview");
string value = memory.Get(address) as string;
engine.AddScriptOutput(UIVariables.VisualOverview.CreateKey("MyOutput1"), value);
engine.Log("After Visual Overview");
}
}
}

Thank you for the help for a technician who programs 😉

Best regards, Daniel

Daniel Zank [DevOps Advocate] Edited answer 8th January 2025
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

Recent questions

Alarm Dashboard PDF/CSV Export 0 Answers | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 0 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (108) Correlation (68) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (139) driver (65) DVE (55) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (151) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) services (51) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
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