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

DOM updating list values in an instance

Solved1.24K views21st March 2023DOM
4
Jeroen Geldhof [SLC] [DevOps Enabler]5.04K 21st March 2023 1 Comment

I have a DOM instance that contains a list field which needs to be updated (items removed or added).
But I have many problems.

The first issue is that the filters return no results.  I've tried logging the result of the sectionFilter and of the presetNameFilter, but both return 0.

The second issue I have is following the guide on updating a list value in an instance.  I found the following help, but I'm having problems finding out how to integrate these in my use-case.
A domInstance.GetFieldValue function doesn't seem to be found if I try it in Visual Studio.
https://docs.dataminer.services/user-guide/Advanced_Modules/DOM/DOM_examples/DOM_Altering_values_of_a_DomInstance.html

I'm also looking in the 'Example: retrieving a list value', but there it starts from the section and not from the instance.

I think I'm mixing instances and sections in both cases somehow, but could use some help on this.

Jeroen Geldhof [SLC] [DevOps Enabler] Selected answer as best 21st March 2023
Jeroen Geldhof [SLC] [DevOps Enabler] commented 21st March 2023

fyi,

I was able to get it working with following code. Thanks to everyone for helping out.

const string multiviewerSectionDefinition = “55de1c92-c5c3-4b62-95da-b22bfb8cecf1”;
const string multiviewerDomDefinition = “cb0d0301-6099-4714-b7fe-56954b34e6cf”;
const string presetNameFieldDescriptorID = “65f91abc-b98b-4a47-bd91-6c35412e7d50”;
const string channelListFieldDescriptorID = “51c6658c-adee-4444-a78a-75b160b4bad5”;

var mvHelper = new DomHelper(engine.SendSLNetMessages, “multiviewermanagement”);

var sectionFilter = DomInstanceExposers.DomDefinitionId.Equal(new DomInstanceId(new Guid(multiviewerDomDefinition)));
var presetNameFilter = DomInstanceExposers.FieldValues.DictDynamicListField(presetNameFieldDescriptorID).Equal(“Alarm”);
var fullFilter = sectionFilter.AND(presetNameFilter);

var alarmMVPresets = mvHelper.DomInstances.Read(fullFilter);
engine.GenerateInformation(“amount found :”+ alarmMVPresets.Count);

mvHelper.StitchDomInstances(alarmMVPresets);

foreach(DomInstance alarmMVPreset in alarmMVPresets)
{
engine.GenerateInformation(“DOM Instance Name : ” + alarmMVPreset.Name);

Section mySection = alarmMVPreset.Sections.First(x => x.GetSectionDefinition().GetName() == “MV Preset”);

engine.GenerateInformation(“section : ” + mySection.ID);

var fieldValue = mySection.GetFieldValueById(new FieldDescriptorID(new Guid(channelListFieldDescriptorID)));
engine.GenerateInformation(“type of field: ” + fieldValue.Value.Type.ToString() + ” ; field descriptor : ” + fieldValue.GetFieldDescriptor().Name);
var valueWrapper = fieldValue.Value as ListValueWrapper;
List actualList = valueWrapper.Values;

engine.GenerateInformation(“number of channels in preset: ” + actualList.Count);
}

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Jens Vandewalle [SLC] [DevOps Enabler]9.44K Posted 21st March 2023 3 Comments

Hi Jeroen,

Your first filter returns null because you're using the section definition GUID (variable multiviewerSectionDefinition) in a DOM definition exposer. I guess that you'll have a better result if you use variable multiviewerDomDefinition instead.

Related to your 2nd problem you can get the needed section from your instance by using one of below methods.

var sectionGUID = "GUID of the section";
instance.Sections.First(x => x.SectionDefinitionID.Id == Guid.Parse(sectionGUID));

instance.Sections.First(x => x.GetSectionDefinition().GetName() == "Name of the section");

Jeroen Geldhof [SLC] [DevOps Enabler] Posted new comment 21st March 2023
Jeroen Geldhof [SLC] [DevOps Enabler] commented 21st March 2023

Hi Jens, would you know what the error “The Section was not yet stitched to the SectionDefinition” mean when I try to execute the following line?

Section mySection = alarmMVPreset.Sections.First(x => x.GetSectionDefinition().GetName() == “MV Preset”);

Jens Vandewalle [SLC] [DevOps Enabler] commented 21st March 2023

Hi Jeroen, You first need to stitch de DOM instances before you can use names and other objects instead of GUIDs. You can do this with below code:
domHelper.StitchDomInstances(instances);

Jeroen Geldhof [SLC] [DevOps Enabler] commented 21st March 2023

thanks, I got that part working.
I’ll now focus on the editing part of the list.

2
Benjamin Hodžić [SLC] [DevOps Advocate]1.12K Posted 21st March 2023 1 Comment

Hi Jeroen,

Jens answered the first question. But regarding the second issue, GetFieldValue is an extension method which is located in the Skyline.DataMiner.Net.Sections namespace, make sure you include it.

GetListFieldValue is located in the Skyline.DataMiner.Net.Apps.Sections.Sections namespace.

If that's not the issue we, make sure you have the latest nuget installed. In my automation script I have the latest prerelease nuget installed - Skyline.DataMiner.Dev.Automation 10.3.2.1

Jeroen Geldhof [SLC] [DevOps Enabler] Posted new comment 21st March 2023
Jeroen Geldhof [SLC] [DevOps Enabler] commented 21st March 2023

Thanks Benjamin.
I indeed needed to add these namespaces.

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

Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes
When using the Setter = true attribute, will the copy action always be executed first? 1 Answer | 2 Votes
Multiple Set on Table parameters for DVE’s 1 Answer | 2 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 (109) Correlation (69) Correlation rule (52) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) 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