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

What (and why) is the impact of changing my public class to public static class in DataMiner?

Solved1.71K views8th July 2020Automation QAction
3
Brecht Deconinck [SLC] [DevOps Member]1.20K 23rd June 2020 0 Comments

Scripting

What's the impact of changing my "public class QAction" to "public static class QAction"?
If there's an impact, what's the reason behind this?

Automation

What's the impact of changing my "public class Script" to "public static class Script"?
If there's an impact, what's the reason behind this?

Brecht Deconinck [SLC] [DevOps Member] Selected answer as best 8th July 2020

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Wouter Demuynck [SLC] [DevOps Advocate]5.93K Posted 8th July 2020 0 Comments

The main thing to be aware is that static fields and properties are shared across either the entire SLAutomation or SLScripting engine. For example, static fields and properties are shared across multiple runs of the same script or QAction and get remembered as long as the DataMiner Agent or hosting process doesn't restart. Be aware that locking is needed when accessing the same static data structures from multiple simultaneously running automation scripts/QActions.

Marking a class as static indicates that it can only contain static fields, properties and methods and that no instance objects can be created for it. The compiler will complain if you would try to do add non-static fields/properties/methods.

The main difference in behavior is with the entry point into an automation script or QAction ("Run" method).

  • If the Run method is marked as static, an automation script or QAction execution will not create an object instance of the class, and only static data can be accesses from within the script/QAction.
  • If the Run method is non-static, an instance object will be created either per automation script run or per element run (for QActions). The script can then access both instance-level fields/properties from this instance, but can also access static fields if these are defined.
    The main difference between Automation scripts and QActions is that for QActions, the instance object is re-used across QAction invocations for the same element while for Automation scripts every run creates a new temporary instance object.

I would advise to mark your class as static if you want to use the static Run method, as any instance fields/methods/properties won't make much sense in that scenario.

Brecht Deconinck [SLC] [DevOps Member] Selected answer as best 8th July 2020
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