I am using com.inductiveautomation.ignition.gateway.tags.model.GatewayTagManager#importTagsAsync to create tags directly and it is working great.
However if I import a folder that is already present, it doesn't remove any tags not present in the new import.
I.e.
Starting:
MyFolder
- Tag A
- Tag B
Import:
MyFolder
- Tag B
- Tag C
End Result:
MyFolder
- Tag A
- Tag B
- Tag C
My Desired Result:
MyFolder
- Tag B
- Tag C
Is it possible to achieve the desired output with the current importTagsAsync function I am using? Or do I need to delete the tags present first?
Secondly, what method should I be looking for to delete the tags? I have tried com.inductiveautomation.ignition.common.tags.model.TagProvider#removeTagConfigsAsync but it doesn't look like it's removing the tags.
Yeah I have been using Overwrite and it isn't doing what I am looking for. It is just overwriting instances of the tags present, not the folders and their contents.
If I need to do this in two operations, what would be the actual method needed to delete tags at all? The removeTagConfigAsync doesn't seem to be deleting the tags, even when it returns a quality of Good.
Look closer at the constructor for BasicTagPath you're using. You're only passing a source argument; that's why it's not working.
You can either pass a source and a List, or you could use a static method from TagPathParser, or you could create a new BasicTagPath("default") and then call getChildPath(String), but whatever you do, the way you're doing it right now is wrong
I have a very similar application, I am importing with system.tag.importTags(), but as stated above when a tag doesnt exist in the new set, it doesnt get deleted.
What would be the best approach? I want to delete all UDT definitions before importing the new ones.