Import XML Workspace Document to existing fgdb doesn't overwrite domains

1704
7
03-04-2020 01:28 PM
JimmyKnowles
Occasional Contributor II

Here's our typical workflow:

  1. Design database using Enterprise Architect
  2. Export to xml workspace document
  3. Import to file geodatbase from xml workspace document in ArcGIS Pro
  4. Repeat steps 1-3 as needed importing to same fgdb each time in Step 3

In ArcGIS Pro, even though the domains get updated, the changes don't appear in the Domains view. If I export back out to xml workspace document in Pro and I look at the exported xml, I can confirm that the xml has the domain changes.

EDIT: this is not correct. The exported xml does not have the changes. The tool apparently is not overwriting existing domains.

I've even closed out the Pro project, reopened it, and the domains as seen in Domains view do not reflect any domain changes.

This has also happened when I use the Table to Domain tool with update_option='REPLACE'. The tool runs successfully, but the changes don't show up in the Domains view.

EDIT: The issue with Table to Domain seems to be a separate issue.

Is there any way to refresh the Domains view to reflect what is actually in the fgdb?

7 Replies
KoryKramer
Esri Community Moderator

Hey Jimmy - I recall looking at some weird behavior around the domain view and found that thread here: https://community.esri.com/ideas/17610 

Unfortunately there is an underlying bug here (some details in that other thread).  Since you mention closing and re-opening the project, I have to ask, have you tried closing and re-opening the Domains View?  

Also, in your project, do you have map layers that have your fgdb as a data source?  

What happens if you open an untitled project, no map, and open the Domains View of the file geodatabase?

0 Kudos
JimmyKnowles
Occasional Contributor II

Hey Kory - thanks for finding that idea for me. My searching skills were a little sub-par today  Glad it's not just me with this problem or a similar one. Though after some further testing, I think they are two separate problems. One is with domains not refreshing after using the 'Table to Domain' tool, the second being domains not updating using 'Import XML Workspace Document' on an existing fgdb w/ existing domains.

1. Yes, I have opened and closed Domains View. Same behavior.

2. Yes, there are map layers that have the fgdb as the data source. And when I use those layers, they do not respect the changes. For example, I just created symbology from an updated domain and it used the old values.

3. If I open a new instance of Pro, no map, add that fgdb as one of the project's databases, Domains View still shows the 'cached' domains. This had the existing instance of Pro open with my original project w/ the map.

I also closed all instances of Pro, and repeated # 3 above. Same behavior.

I was wrong in my initial post, when I export back to xml, the changes are not reflected

I tried 'import XML workspace document' in ArcCatalog as well and it complains that there are existing feature classes and wants to create duplicates of everything appended w/ '_1'. It doesn't seem to have a problem with domains. Pro gives a warning that everything will be overwritten, but it appears it's not overwriting the domains. It does update any attribute changes that I make.

All of this leads me to believ that the 'Import XML Workspace Document' tool is not overwriting the existing fgdb even though the warning says it will do that. I think my workaround will be just to write a python script that deletes all layers, tables, then domains, and then imports the xml workspace document.

The help for the 'Import XML Workspace Document' mentions overwriting and I have that checked in options. Maybe this is expected behavior, but it would be nice to have some feedback letting the user know that existing domains will not be updated, but attributes will.

My workaround is to use a python script that deletes all layers, tables, then domains, and then imports the xml workspace document. Works like a charm and keeps me from having to update the source of layers to a new fgdb every time I make changes. 

0 Kudos
KoryKramer
Esri Community Moderator

Thanks for the update, Jimmy.  I looked to see if there are any known issues with the Import XML Workspace Document tool, and don't see anything.  I'm glad that you have a Python workflow that works for you.  If you want us to take a deeper look, you could send me the xml generated from Enterprise Architect and we'll work with that... 

Cheers

0 Kudos
JimmyKnowles
Occasional Contributor II

Kory - I did some more testing and I'm pretty sure my conclusion is that the 'Import XML Workspace Document' tool will not make changes to existing domains in an fgdb. It doesn't have an issue making attribute changes. Here's what I did to test this:

Test domain change:

  • Removed domain value from domain in exported XML from Pro (I worked with XML produced by Pro because I have had issues with XML produced by Enterprise Architect. It's a great tool, but doesn't do a great job producing fully compliant XML. I wanted to take this out of the equation.)
  • Imported modified xml into existing fgdb
  • Without closing Pro, change did not show up in Domains View even after closing and reopening Domains View
  • Closed Pro, reopened Pro, added fgdb to project, opened Domains View, change did not show up
  • Created new empty fgdb
  • Imported XML into new empty fgdb
  • Change shows up

Test attribute change:

  • removed attribute from FC in exported XML from Pro
  • imported modifed xml into existing fgdb
  • change shows up immediately in Fields View

This may be the expected behavior. If it is, I think the warning or the documentation should let the user know that domains won't be updated with this tool.

I've attached the XML exported from Pro if you'd like to look into this further. Using X-ray in ArcCatalog it identifies some issues with the XML that Enterprise Architect generates and since I tested that the issue exists with the XML exported from Pro, I think it makes sense to use 'good' XML for any further testing. This isn't a very simple fgdb (9 feature classes, 1 table, 9 relationship classes, 35 domains), so it might be worth testing with a simpler fgdb. I'm done playing for now since I have my workaround.

Okay, I can't help myself....I changed my mind and decided to test with a simple fgdb. Here's what I did:

  • Test domain change
    • created fgdb, one FC, one domain (3 domain values), one field using that domain, two additional fields
    • exported to XML from Pro
    • edited XML to remove one of the domain values
    • imported XML to existing fgdb
    • change was not reflected in fgdb in Domains View
    • created empty fgdb
    • imported XML into empty fgdb
    • change was reflected in formerly empty fgdb in Domains View
  • Test attribute change
    • edited same XML to remove one of the fields
    • imported XML to existing fgdb
    • change shows immediately in Fields View

So, conclusion is the same...'Import XML Workspace Document' doesn't appear to modify existing domains, but will modify fields.

KoryKramer
Esri Community Moderator

Hi Jimmy, I hope you are well and I apologize for the delayed response on this.  I've run through your steps and I see the same thing; i.e. even though the Import XML Workspace Document tool indicates that the domain data element imported, the existing domain is not updated.  I'm checking with the team that owns that tool to determine whether this is an issue with the tool or the documentation.  

Thank you for taking the time to thoroughly document and describe the issue.  That is incredibly helpful!  I'll follow-up here with what I hear back from the team.

Cheers

0 Kudos
JimmyKnowles
Occasional Contributor II

Hey Kory, likewise, hope you and yours are well. Thanks for the follow-up on this! No worries on the delay.

0 Kudos
KoryKramer
Esri Community Moderator

If you need to track this, I submitted [BUG-000130056: Import XML Workspace Document does not update domain values in the destination workspace.]  

Cheers