I successfully set up a Scripted (Python) Published Parameter called GIS_FILESHARE_ROOT.
The script has the following code:
import sys
sys.path.insert(0, FME_MacroValues,'FME_MF_DIR'])
import config
return config.GIS_FILESHARE_ROOT
This imports config. Config is located in a subdirectory called 'config' of where the fmw lives. This subdirectory has an __init__.py file with the following code:
import os
GIS_FILESHARE_ROOT = os.path.abspath(r'\\server\dir\to\the\filestore\root')
A shapefile reader was added pointing to $(GIS_FILESHARE_ROOT)\sub\shp_folder\TheShapeFile.shp and this successfully reads the shapefile.
But, when I try do a similar thing but with a shapefile writer, I get an error.
Undefined macro 'GIS_FILESHARE_ROOT' dereferenced in file ...
Can someone help me understand what's happening and how can I setup a similar dynamic root config like I did with the reader?