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
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
      • Learn more about 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)
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Pogram
    • DataMiner DevOps Support
    • Feature Suggestions
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

DOM Query Filtering

65 views2 hours agoDOM dom filter filtering
1
Fenta Alemahu [SLC] [DevOps Enabler]1.15K 5 hours ago 0 Comments

Hi all,

We have a use case where we want to filter DOM Instance fetching. We have two field descriptors for the filter. We want to exclude a DOM instance if it satisfies both conditions. The excluded items are lists (not single ones).

Let’s say we have field descriptors 1 and 2.  I want to exclude DOM Instances that have fieldDescriptor1 value A and fieldDescriptor2 value B, fieldDescriptor1 value C and fieldDescriptor2 value D, …The excluded items are (A, B), (C, D), (E, F), …

I tried the following:

var filter1 = excludedItems.Select(e => DomInstanceExposers.FieldValues.DomInstanceField(fieldDescpitorId1).NotEqual(e.Item1));

var filter2 = excludedItems.Select(e => DomInstanceExposers.FieldValues.DomInstanceField(fieldDescpitorId2).NotEqual(e.Item2));

var filters1 = new ANDFilterElement<DomInstance>(filter1.ToArray());

var filters2 = new ANDFilterElement<DomInstance>(filter2.ToArray());

var filters = new ANDFilterElement<DomInstance>(filters1, filters2);

When using the above filtering, the query discards all items that have fieldDescriptor1 value A (whatever the value of fieldDescriptor2 is) and vice versa. So, I want a filter that combines the two filters, meaning discard an instance if fieldDescriptor1 has value A and fieldDescriptor2 has value B.

Thomas Ghysbrecht [SLC] [DevOps Enabler] Answered question 4 hours ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Thomas Ghysbrecht [SLC] [DevOps Enabler]5.16K Posted 4 hours ago 0 Comments

Hi Fenta,

A filter like that should be possible by having one of these filters for each exclusion pair:

NOT ( 'Field 1 = A' AND 'Field 2 = B' )

If you then AND these together, this should result in the exclusion of those pairs. In code, it could look like this:

var relationsToExclude = new[] {
("A", "B"),
("C", "D"),
("E", "F"),
};

var filters = relationsToExclude.Select(one => new ANDFilterElement<DomInstance>(
DomInstanceExposers.FieldValues.DomInstanceField(_fieldDescriptorId1).Equal(one.Item1),
DomInstanceExposers.FieldValues.DomInstanceField(_fieldDescriptorId2).Equal(one.Item2)).NOT());

var fullFilter = new ANDFilterElement<DomInstance>(filters.ToArray());

It does seem however, that the evaluation of this type of filter may result in a very large operation as the DB layer in DataMiner may convert this to another format that results in a OR filter with 2^n sub filters, where 'n' equals the amount of combinations you have. I would thus recommend keeping this filter combination very short (<10), or simply avoid the need for a large exclusion query, as this in itself is sometimes a red flag when building solutions. Feel free to share more details about this solution, I'll gladly help find alternative ways to get a performance and scalable result.

Thomas Ghysbrecht [SLC] [DevOps Enabler] Answered question 4 hours ago
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