System.tag.configure with UDTs in Folder

Hi,

I’m trying to create a script that will take UDT definitions from one provider and distribute it to other providers on the same gateway. EAM can send it to the source provider on each gateway and this script can send it to the rest of the tag providers.

The issue I’m experiencing is that the configuration on the target somehow inserts a _types _ subfolder. See code and result below:

def syncUDTs(sourceProvider, targetProviders = None):

	configs = system.tag.getConfiguration('['+sourceProvider+']_types_/Test Folder', True)
	for target in targetProviders:
		system.tag.configure('['+target+']_types_', configs, "o")
	
	return

syncUDTs('Development', targetProviders = ['udtSync'])

image

The config doesn’t seem to contains _types _ subfolder under the Test Folder, hence I don’t know how to get rid of it. See configs below (the print mangled the quotations):

[
    {'tags': [
            {'path': Test UDT 2, 'tagType': UdtType, 'name': 'Test UDT 2', 'typeId': None
            },
            {'path': Test UDT 1, 'tagType': UdtType, 'name': 'Test UDT 1', 'typeId': None
            }
        ], 'path': [Development]_types_/Test Folder, 'tagType': Folder, 'name': 'Test Folder'
    }
]

Is this a bug or can I somehow get the UDTs into the target while preserving the original structure?

Thanks,
Deon

2 Likes

Has this issue been resolved? I’m having the same problem.

I just tried this in 8.1.17 and ran into the same issue. It seems a “types” parent folder is added to the whole configuration as well as above the type definitions in any subfolders (original tag configuration read did not include the highlighted folders below):
image
Has anyone found a workaround for this?

I did solve this, but it involve some string manipulation to filter out the types

1 Like