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
  • Downloads
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Solutions
    • Deal Registration
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

How to filter DOM objects

Solved665 views7th July 2023
2
Julio Riambau [SLC] [DevOps Advocate]302 7th July 2023 0 Comments

Hi Team,

Could you please let me know what would be the proper way to filter DOM objects?

Example use case, i want to know is an upgrade object with some specific properties is already present to determine whether i should create a new one or update it.

currently using this code:

public static DomInstance GetUpgrade(this UpgradeModule upgradeModule, UpgradeFieldsGeneralValues upgrade)
{
var customerDescriptorId = UpgradeDomDefinition.UpgradeSectionGeneralInfo.FieldDescriptors.CustomerDcpId.ID;
var customerFilter = DomInstanceExposers.FieldValues.DomInstanceField(customerDescriptorId).Equal(upgrade.CustomerDcpId);

var dmaDescriptorId = UpgradeDomDefinition.UpgradeSectionGeneralInfo.FieldDescriptors.DmaId.ID;
var dmaFilter = DomInstanceExposers.FieldValues.DomInstanceField(dmaDescriptorId).Equal(upgrade.DmaId);

var previousVersionDescriptorId = UpgradeDomDefinition.UpgradeSectionGeneralInfo.FieldDescriptors.PreviousVersion.ID;
var previousVersionFilter = DomInstanceExposers.FieldValues.DomInstanceField(previousVersionDescriptorId).Equal(upgrade.PreviousVersion);

var newVersionDescriptorId = UpgradeDomDefinition.UpgradeSectionGeneralInfo.FieldDescriptors.NewVersion.ID;
var newVersionFilter = DomInstanceExposers.FieldValues.DomInstanceField(newVersionDescriptorId).Equal(upgrade.NewVersion);

var filter = customerFilter.AND(dmaFilter).AND(previousVersionFilter).AND(newVersionFilter);
return upgradeModule.DomHelper.DomInstances.Read(filter).FirstOrDefault();
}

as reference i’m using: https://docs.dataminer.services/user-guide/Advanced_Modules/DOM/DOM_examples/DOM_Invoice_app_example.html#readingfiltering-dom-instances

thanks in advance

Julio Riambau [SLC] [DevOps Advocate] Selected answer as best 7th July 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
4
Thomas Ghysbrecht [SLC] [DevOps Enabler]4.91K Posted 7th July 2023 1 Comment

Hi Julio,

Does the code you posted work for your use case? Because from what I can tell, it looks correct. You need to define separate filters for all the conditions that should be met and then merge them in an ‘AND’ filter. The only recommendation I would have is to pass the individual filtering to the constructor of the ANDFilterElement. But in the end, it doesn’t matter all that much.

Julio Riambau [SLC] [DevOps Advocate] Selected answer as best 7th July 2023
Julio Riambau [SLC] [DevOps Advocate] commented 7th July 2023

thank you very much Thomas yes it works, just wanted to verify if it was a proper approach

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