Here's our typical workflow:
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?
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?
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.
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...
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:
Test attribute change:
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:
So, conclusion is the same...'Import XML Workspace Document' doesn't appear to modify existing domains, but will modify fields.
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.