Question

List writer feature type names in startup/shutdown script

  • 31 March 2015
  • 3 replies
  • 0 views

Badge +5
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

Badge
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
Badge +5
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.
Userlevel 4
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

 

 

Reply