Product: TIBCO Spotfire®
How to programmatically identify if a TERR script is running locally or on the TSSS server.
In some scenarios, it might be required to detect in the script itself whether a Spotfire data function's TIBCO Enterprise Runtime for R (TERR) script is being executed by the Spotfire desktop client's own built-in local TERR engine or sent out to a TIBCO Spotfire Statistics Services (TSSS) instance on a server.
TERR's grepl() function can be used to achieve this requirement.
The following command can be used to test whether or not a data function's TERR script is being sent to the desktop client's own local TERR engine or sent out to a TSSS/TERR instance:
grepl( "Modules", Sys.getenv( "TERR_HOME" ) )
This call to grepl() looks for the string "Modules" in the "TERR_HOME" environment variable. A default TERR_HOME path in a TSSS/TERR instance will not include the "Modules" string, but the TERR_HOME path in the desktop client's local TERR engine will.
If the above command returns TRUE, the data function is using the Spotfire desktop client's local built-in TERR engine.
Comments
0 comments
Article is closed for comments.