I’m trying to update Tag values from within my module. The code is more or less this:
TagProvider provider = context.getTagManager().getTagProvider("default");
Tag tag = provider.getTag(path);
if (tag instanceof ExecutableTag)
((ExecutableTag)tag).updateCurrentValue(new BasicTagValue(1, DataQuality.GOOD_DATA));
The problem I’m having is, this code works from certain threads but not from others.
Works well from: Web server threads, servicing incoming connections. TagChangeEvent calls.
Doesn’t work from: Tasks registered with the ExecutionManager. Other Threads I start manually. (I use this task to mark Tags as STALE if not updated after a certain amount of time).
I’m testing with the built-in realtime memory tags provider.
Any insight here would be greatly appreciated.