I have been trying to use runScript("system.tag.exists", 0, {tag_Path}) and I am seeing something weird. If the path doesn't exist the expression returns False, however, if the tag does exist then I get an error,
I don't think you want the {} in the expression, as the argument you are passing is supposed to be a string representing a possible tag path, as opposed to the value of an actual tag.
runScript("system.tag.exists",0,"path/to/tag")
I believe you are getting the error because the expression is trying to parse the tag path. When the path doesn't exist then it sends a value of "none", which incorrectly returns the correct value because the path "none" doesn't exist. When the path does exist, then it tries to send the value of the tag which probably can't be properly parsed to a valid path.
Personally, I would use the approach that @dkhayes117 showed, because then you don't have to pay the cost of starting up the interpreter.
Thanks, that was the issue. I was actually using relative paths from a property but had been using Tag() so it's the same idea. If I remove the Tag() then it appears to work like it should
My concern with isGood is that I have a bunch of radio based sites that can have enough delay to cause Bad statuses. Things would be blinking all over the place.
I'm not sure what the resource cost of the interpreter is but server wise I have a lot to work with.
For posterity, I'll note that the system.tag.exists function is just doing a tag read of the .Name subproperty (because .Value can be expensive to read for some types of tags). So if you already have a path to a tag, qualityOf({that/tag/path.name}) != "Bad_NotFound" will give you the exact same result as system.tag.exists.
Or isAvailable() from Paul's Ignition Extensions module, which checks if the tag is both not disabled and exists, because those are the only two states in which you would want to hide something using, otherwise you would be masking a genuine issue. (to test for these two qualities without isAvailable is a horrible monster of an expression)
Still hoping that this makes it into the product!!!!
thanks. there is a lot of very cool, and pretty much required parts for my operators, that exists but hasn't made it into the product, Paul's extensions and the Ad-Hoc Trends and Rosters come to mind.