Have you ever wondered how you, or someone else, have configured a geodatabase and where is the missing piece of the puzzle that is causing havoc? Have you ever opened thousand FeatureClasses to check if a single AutoUpdater was set?

 

I could continue forever, but you all got the idea, if you ever had to dig into ArcFM configurations, luckily in the recent versions of ArcFM there is an useful panel in ArcCatalog showing the configurations, but it's for a single item at a time, try to check it on the minerville sample database, if you dare.

 

The bad news is that there is no clear place where to check the configurations, you could look for model names into the MM tables, but auto updaters and custom editors are hidden inside big blobs, and even then, file geodatabases are not easily queryable.

 

To solve this problem in a very easy and customizable way, I have used three things:

 

  1. ArcFM xml export of the ArcFM Properties
  2. LINQPad
  3. Microsoft Linq to XML

 

The first step should come easy, open ArcCatalog, right click your database connection or a single dataset and select "ArcFM XML Export", then export only the ArcFM Properties

export.png

 

Once you have your shiny new xml in a known location, you need to download and install LINQPad ( https://www.linqpad.net/ )

 

This magical program lets you instantly execute any C#, F#, VB snippet, without having to compile a full program, you can literally paste snippets from the web and execute them without any struggle, if you are familiar with the Microsoft .NET languages you will love this tool.

 

Once installed, we'll use a bit of Linq to XML to quickly read our xml and show the information we need; Linq is the short for Language INtegrated Query, it's something that lets you write and execute SQL like queries basically on every enumerable thing you can find, and an xml is an enumeration of nodes, or elements, where every single node could have attributes or other child nodes; Linq to XML is an extension of Linq that is dedicated to access and query xml in an easy and fast way.

 

So, open LINQPad, create a new query, select "C# Statement(s)" as the language and paste the following snippet

 

XDocument doc = XDocument.Load(@"C:\temp\arcfm_properties.xml");

var items = from n in doc.Descendants("AUTOVALUE")
               where n.Attribute("EDITEVENT").Value != "mmEventValidationRule"
                    && n.Element("AUTOVALUENAME") != null 
                    //&& !n.Element("AUTOVALUENAME").Value.Contains("ESRI")
                    //&& !n.Element("AUTOVALUENAME").Value.Contains("ArcFM")
          select new
          {
               Name = n.Element("AUTOVALUENAME").Value,
               Class = n.Parent.Parent.Name == "FEATURECLASS" ? n.Parent.Parent.Element("FEATURENAME").Value : n.Parent.Parent.Parent.Element("FEATURENAME").Value,
               AUType = n.Parent.Parent.Name == "FEATURECLASS" ? "Class" : "Field",
               Field = n.Parent.Parent.Name != "FEATURECLASS" ? n.Parent.Element("FIELDNAME").Value : "N/A",
          };

var grouped = from n in items
                group n by new { n.Name, n.Class, n.AUType, n.Field };

grouped.Select(g => g.Key).Dump();



 

You just need to fix the xml path in the first line, and you are good to go, just press F5 or click the green arrow and you'll see the results, for example extracting just the DistributionMain results we'll have:

 

ArcFM Length Measured DomainDistributionMainFieldMEASUREDLENGTH
ArcFM Date Time PickerDistributionMainFieldINSERVICEDATE
ArcFM User NameDistributionMainFieldCREATIONUSER
ArcFM Current DateDistributionMainFieldDATECREATED
ArcFM Current DateDistributionMainFieldDATEMODIFIED
ArcFM User NameDistributionMainFieldLASTUSER
ArcFM Gas Distribution Main Trace WeightDistributionMainFieldGASTRACEWEIGHT
ArcFM Available Work FunctionsDistributionMainFieldWORKFUNCTION
ArcFM Inherit Operating PressureDistributionMainClassN/A
ArcFM Detect CP Continuity ChangeDistributionMainClassN/A

 

I have left two commented lines to remove from the list ESRI and ArcFM results, if you need to show only custom Auto Updaters (we have a lot of those) just delete the // and uncomment

 

The "select new" part is where a lot of the fun is, using the .Parent I an check parent nodes and distinguish between class AUs and field AUs, but you can use the same technique for every information in the ArcFM Properties, I have scripts to extract QaQc rules, to check domains, and a lot of other things that are really easy to do, you just need to give a good look at the xml and write the appropriate script.

 

If you need to check for a specific AutoUpdater or to check specific classes, you just need to add the where clause in the appropriate place, lightning fast

 

This is a screenshot of my linq pad interface

linqpad.png

 

This post is based on the xml extracted from a 10.2.1c minerville sample database, using just the ElectricDataset.

 

If you need further details or any help on running the tool or the script, just feel free to ask, this is a very powerful way to dig into ArcFM configurations

 

Have Fun

 

Fra