Skip to main content
Question

List writer feature type names in startup/shutdown script


john_gis4
Contributor
Forum|alt.badge.img+13
I have a workbench which writes to some Esri Geodatabase feature classes and need to run some arcpy commands on each target feature class before and after the workbench completes. 

 

 

At the moment I am hard coding the target feature class names in the python startup/shutdown script, but would really like to pick these up from the workbench by getting a list of writer feature type names. 

 

 

I'm thinking it must be possible to list the writer feature type names that are defined in the workspace using fmeobjects? 

3 replies

Forum|alt.badge.img
  • March 31, 2015
HI John

 

I'm afraid there is no way to get the dest feature type names from a Workspace in FMEObjects.  There is an FMEWorkspaceRunner() class which has a method to get parameters but not feature types names. There might be a way around this if you are writing in dynamic mode but you could only get them in the shut down and not in the start up script. Would that still help you?

 

 

Ken

john_gis4
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • March 31, 2015
Ok - seems odd that. 

 

 

Is there a way to get the path of the currently executing workbench (fmw) file then? I could possibly write some python to read the feature types from that.

david_r
Celebrity
  • April 2, 2015
Hi,

 

 

have a look at the internal parameters FME_MF_DIR and FME_MF_NAME, both available at runtime:

 

 

current_ws_dir = FME_MacroValues['FME_MF_DIR']

 

current_ws_filename = FME_MacroValues['FME_MF_NAME']

 

current_ws = current_ws_dir + current_ws_filename

 

 

David

 

 

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