Skip to main content
Question

List writer feature type names in startup/shutdown script

  • March 31, 2015
  • 3 replies
  • 27 views

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? 
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

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