Skip to main content
I have a workflow which has

 

1. Genereric Reader

 

2. Sampler - Which will send onle 1 feature

 

3. GeometryFilter- To decide geometry type of source data possible values are Polygon, Point and non-geom data

 

 

Now I have 3 different workspaces for above 3 conditions. To decide which workspace to run I have written a shutdown python script which will run WorkspaceRunner and it will decide which workspace to run. but I am not able to use vaiable I set in workflow to decide the workspace.

 

 

In short I need to use variable defined in workflow in Python script?

 

 

Note: I don't want to use WorkspaceRunner as I am publishing this to FME server.

 

 

Hi,

 

 

A PythonCaller with a script which define a Python global variable can be used.

 

-----

 

# PythonCaller Script Example

 

import fmeobjects

 

def processFeature(feature):

 

    global g_value

 

    g_value = feature.getAttribute('AttributeName')

 

-----

 

You can then access the global variable (g_value) in the Shutdown Python Script.

 

Hope this helps.

 

 

Takashi
Thanks Takashi. That's wroked well.

Reply