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 to retrieve a class that implements IDms with the IGQIOnInit?

Solved905 views6th January 2025GQI IDms
2
Michiel Saelen [SLC] [DevOps Enabler]5.63K 5th July 2023 0 Comments

We have created libraries that make use of the IDms class library. These libraries provide interfaces/classes that make sense to the solution. These libraries can then be used in Automation Scripts, Protocols and external tools in C# code.

In order to reuse these libraries in our ad-hoc data sources, we want to retrieve an object that implements the IDms interface as provided by Skyline.DataMiner.Core.DataMinerSystem.Common library. We would like to retrieve the object from the IGQIOnInit | DataMiner Docs method. The GQIDMS class does not implement any interface and IMO would make more sense that the class implements the IDms interface as this is now the most common way to retrieve information from a DMS.

With the current features available, what is the best way to get an object that implements the IDms interface from the IGQIOnInit method?

Michiel Saelen [SLC] [DevOps Enabler] Selected answer as best 6th January 2025

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
1
Simon Vandamme [SLC] [DevOps Advocate]942 Posted 6th January 2025 0 Comments

Hi all,

Starting from DM Feature release 10.4.6 or DM Main release 10.5.0, DM now exposes the underlying GQI SLNET connection to extensions like Ad Hoc data sources and custom operators.

More information can be found on DataMiner Docs: GQIDMS class | DataMiner Docs

Michiel Saelen [SLC] [DevOps Enabler] Selected answer as best 6th January 2025
2
Tom Waterbley [SLC] [DevOps Catalyst]8.86K Posted 5th July 2023 6 Comments

Hi Michiel, currently there is no straightforward way to get an IDms object in the IGQIOnInit method. However, by creating a class that implements the ICommunication interface, based on the GQIDMS you can get close. Unfortunately the GQIDMS object lacks methods to use subscriptions, so it could be that certain functionality doesn't work.

public class DataSource : IGQIOnInit
{
public OnInitOutputArgs OnInit(OnInitInputArgs args)
{
var dms = DmsFactory.CreateDms(new GqiConnection(args.DMS));

}

}

public class GqiConnection : ICommunication
{
private readonly GQIDMS _gqiDms;

public GqiConnection(GQIDMS gqiDms)
{
_gqiDms = gqiDms ?? throw new ArgumentNullException(nameof(gqiDms));
}

public DMSMessage[] SendMessage(DMSMessage message)
{
return _gqiDms.SendMessages(message);
}

public DMSMessage SendSingleResponseMessage(DMSMessage message)
{
return _gqiDms.SendMessage(message);
}

public DMSMessage SendSingleRawResponseMessage(DMSMessage message)
{
return _gqiDms.SendMessage(message);
}

public void AddSubscriptionHandler(NewMessageEventHandler handler)
{
throw new NotImplementedException();
}

public void AddSubscriptions(NewMessageEventHandler handler, string handleGuid, SubscriptionFilter[] subscriptions)
{
throw new NotImplementedException();
}

public void ClearSubscriptionHandler(NewMessageEventHandler handler)
{
throw new NotImplementedException();
}

public void ClearSubscriptions(NewMessageEventHandler handler, string handleGuid, bool replaceWithEmpty = false)
{
throw new NotImplementedException();
}
}

Michiel Saelen [SLC] [DevOps Enabler] Unselected an answer 6th January 2025
Tom Waterbley [SLC] [DevOps Catalyst] commented 6th July 2023

Another option could be to use the static “Engine.SLNetRaw” property, but not sure if that works or not:
var dms = DmsFactory.CreateDms(new RemotingCommunication(Engine.SLNetRaw));

Michiel Saelen [SLC] [DevOps Enabler] commented 7th July 2023

Hi Tom,
I was able to compile from the automation module and the source is available on my dashboards, however when I select it I get the following error:
Error trapped: Error thrown in implementation of OnInit: Could not load file or assembly ‘SLManagedAutomation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Emir Varupa [SLC] [DevOps Advocate] commented 21st July 2023

Hello Tom,

Seems like this method will only work if you have single responses from the SLNet calls.
For example: The GetElements will only return one element currently.

Michiel Saelen [SLC] [DevOps Enabler] commented 26th July 2023

FYI: If you change the DMSMessage[] SendMessage() implementation to return _gqiDms.SendMessages(message) instead it will work.

Tom Waterbley [SLC] [DevOps Catalyst] commented 17th November 2023

Indeed, I’ve updated my answer. The class can also be downloaded from https://gist.github.com/TomW-Skyline/188d70e8cb775087e7718359fab9a158.

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

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