This could be done using FME in 2019 but this does not work anymore so Python is the way to go. I'm by no means an expert but this works for me.
import fme
import fmeobjects
import arcpy
               Â
def processFeature(feature):
    pass
Â
class FeatureProcessor(object):
    def __init__(self):
        pass
       Â
    def input(self,feature):
        print("TEST TEST")
        domains = arcpy.da.ListDomains("C:/Temp/test.gdb")
        for domain in domains:
            print('Domain name: {0}'.format(domain.name))
            if domain.domainType == 'CodedValue':
                coded_values = domain.codedValues
                for val, desc in coded_values.items():
                    #create a feature for each coded value
                    newFeature = fmeobjects.FMEFeature()
                    #create attribute DomainName
                    newFeature.setAttribute('DomainName',domain.name)
                    #create attribute DomainType
                    newFeature.setAttribute('DomainType',"CodedValue")
                    #create attribute DomainCode
                    newFeature.setAttribute('DomainCode',val)
                    #create attribute DomainDescription
                    newFeature.setAttribute('DomainDescription',desc)
                    #output each feature
                    self.pyoutput(newFeature)
            elif domain.domainType == 'Range':
                #create a feature for each minimum range value
                newFeature = fmeobjects.FMEFeature()
                #create attribute DomainName
                newFeature.setAttribute('DomainName',domain.name)
                #create attribute DomainType
                newFeature.setAttribute('DomainType',"Range")
                print(domain.rangeÂ0])
                #create attribute RangeMin
                newFeature.setAttribute('RangeMin',domain.rangen0])
                #create attribute RangeMax
                newFeature.setAttribute('RangeMax',domain.rangeÂ1])
                #output each feature
                self.pyoutput(newFeature)
               Â
    def close(self):
        pass
       Â
Â
This could be done using FME in 2019 but this does not work anymore so Python is the way to go. I'm by no means an expert but this works for me.
import fme
import fmeobjects
import arcpy
               Â
def processFeature(feature):
    pass
Â
class FeatureProcessor(object):
    def __init__(self):
        pass
       Â
    def input(self,feature):
        print("TEST TEST")
        domains = arcpy.da.ListDomains("C:/Temp/test.gdb")
        for domain in domains:
            print('Domain name: {0}'.format(domain.name))
            if domain.domainType == 'CodedValue':
                coded_values = domain.codedValues
                for val, desc in coded_values.items():
                    #create a feature for each coded value
                    newFeature = fmeobjects.FMEFeature()
                    #create attribute DomainName
                    newFeature.setAttribute('DomainName',domain.name)
                    #create attribute DomainType
                    newFeature.setAttribute('DomainType',"CodedValue")
                    #create attribute DomainCode
                    newFeature.setAttribute('DomainCode',val)
                    #create attribute DomainDescription
                    newFeature.setAttribute('DomainDescription',desc)
                    #output each feature
                    self.pyoutput(newFeature)
            elif domain.domainType == 'Range':
                #create a feature for each minimum range value
                newFeature = fmeobjects.FMEFeature()
                #create attribute DomainName
                newFeature.setAttribute('DomainName',domain.name)
                #create attribute DomainType
                newFeature.setAttribute('DomainType',"Range")
                print(domain.rangeÂ0])
                #create attribute RangeMin
                newFeature.setAttribute('RangeMin',domain.rangen0])
                #create attribute RangeMax
                newFeature.setAttribute('RangeMax',domain.rangeÂ1])
                #output each feature
                self.pyoutput(newFeature)
               Â
    def close(self):
        pass
       Â
Â
Thank you very much @nielsgerrits​  I'll try it. You are being very helpful.
Thank you @hkingsbury​ I'll have a look at the article.
@Anh Phuong Tran​ If you can tolerate step of exporting the Esri Geodatabase XML Workspace document (Schema Only) using Esri ArcCatalog, as described here ,then this article has the FME workspace configured with the XML reader
@Anh Phuong Tran​ If you can tolerate step of exporting the Esri Geodatabase XML Workspace document (Schema Only) using Esri ArcCatalog, as described here ,then this article has the FME workspace configured with the XML reader
It's also possible to use arcpy in a python caller to generate the xml if you don't want that step.
I can probably find a working example if interested
It's also possible to use arcpy in a python caller to generate the xml if you don't want that step.
I can probably find a working example if interested
Yes, I would like to know about that example as well. Will make better automation.
Thanks in advance @ebygomm​Â
It's also possible to use arcpy in a python caller to generate the xml if you don't want that step.
I can probably find a working example if interested
So this is the sort of workflow I've used previouslyIt takes a GDB location, generates an xml file saved in a temp location then reads in the domain values in that file and processes them into features
import fme
import fmeobjects
import arcpy
Â
class FeatureProcessor(object):
Â
    def __init__(self):
        pass
Â
    def input(self, feature):
        in_data = feature.getAttribute('input_GDB')
        out_file = feature.getAttribute('temppath')
        export_option = 'SCHEMA_ONLY'
        storage_type = 'NORMALIZED'
        export_metadata = 'NO_METADATA'
        # Execute ExportXMLWorkspaceDocument
        arcpy.ExportXMLWorkspaceDocument_management(in_data, out_file, export_option, storage_type, export_metadata)
        self.pyoutput(feature)
    def close(self):
        pass
 The FeatureReader is a bit of a pain to setup, as you need to point it to an already created xml file first, before you can swap to use the temp path name.
Thank you @hkingsbury​  I'll have a look at the article.
Python to extract domain values for use in FME - (I've always used the xml method as often when performing validation there are a number of other things I check from the xml as well so not sure whether this code will cover everything)
import fme
import fmeobjects
import arcpy
Â
class FeatureProcessor(object):
    def __init__(self):
        pass
    def input(self,feature):
        self.domains = arcpy.da.ListDomains(feature.getAttribute('input_GDB'))
       Â
    def close(self):
        for domain in self.domains:
         Â
            if domain.domainType == 'CodedValue':
                coded_values = domain.codedValues
                for val, desc in coded_values.items():
                    feature = fmeobjects.FMEFeature()
                    feature.setAttribute("DomainName",domain.name)
                    feature.setAttribute("DomainType",'CodedValue')
                    feature.setAttribute("val",val)
                    feature.setAttribute("desc",desc)
                    self.pyoutput(feature)
           Â
            elif domain.domainType == 'Range':
                    feature = fmeobjects.FMEFeature()
                    feature.setAttribute("DomainName",domain.name)
                    feature.setAttribute("DomainType",'Range')
                    feature.setAttribute("minrange",domain.rangeÂ0])
                    feature.setAttribute("maxrange",domain.range 1])
                    self.pyoutput(feature)
Â
It's also possible to use arcpy in a python caller to generate the xml if you don't want that step.
I can probably find a working example if interested
Perfect, this should work nicely.
Thank you @ebygomm​ for helping me. It is much appreciated.