Skip to main content
Question

Access FME Server Parameters in Workspace

  • July 28, 2021
  • 1 reply
  • 28 views

Forum|alt.badge.img

Hi I am looking for the best practice where to save an sde connection file when publishing to FME Server.

I am thinking to determine the location of the sde connection file using scripted parameter as below.

However when I run the workspace, I get ERROR : Python Exception <KeyError>: 'FME_SHAREDRESOURCE_DATA'

Any suggestions?

 

import fmeobjects

 

if FME_MacroValues['FME_SHAREDRESOURCE_DATA']:

  # Running on FME Server

  return FME_MacroValues['FME_SHAREDRESOURCE_DATA'] + 'connectionFiles/sdefile.sde'

else:

  #Running on FME Desktop

  return '../config/sdefile.sde'

1 reply

Forum|alt.badge.img

Got it working using Get() method FME_MacroValues dictionary

FME_MacroValues.get('FME_SHAREDRESOURCE_DATA')


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings