A strange one…
I have an expression tag that references a tag from a custom module. It works fine at first but whenever I restart the gateway, the expression goes null (unable to find referenced tag path “[myprovider]mytags…”. If I load the designer, make any change to the expression and press ok/apply, it starts working again (must be a ‘reset’).
I get the same issue when I load the SimpleTagProvider example module and reference one of those tags in an expression tag. I also couldn’t find any error indication in the console or the logs.
Is there some way I can get around this through a gateway script (ie. call the “apply changes” code directly) as I need a fix relatively soon?
Just in case anyone is searching the same issue.
I found a hack around this by creating a gateway timer script to read the custom tag and write to a memory tag in the default provider. Then I can reference that tag in my expression.
Good enough for me
I’ll have to look into this, but I bet I can guess what the problem is. I think that neither the simple tag provider nor your custom provider are checking the tag subscription model for existing subscriptions on startup. I could be wrong, because normally the expression is supposed verify the tag exists and then keep retrying until it does, but I see that the simple tag provider isn’t properly checking the model, so there could be something there.
I’m glad you have a work around for now. If you have the ability to modify the custom provider, you might take a look and see how you’re handling the case when TagProvider#startup(TagSubscriptionModel) is called with tags already in the model. The simple tag provider is just subscribing and going from there, which means it misses any existing subscriptions. We should be able to get that fixed for 7.5.8.
I definitely don’t have any checks for existing subscriptions on startup. If I still get the same behaviour with the next version I’ll try making my tag provider startup a little smarter.
Just wanted to let you know that I finally got around to fixing this today. It will be in 7.5.9, and 7.6.1. It now properly updates subscriptions both on startup and shutdown (or when tags are removed from the simpletagprovider, which also wasn’t working quite right).