You can certainly schedule FME processes using FME Server.
However, I believe you can also call an FME workbench using Python. This could easily be scheduled using Task Scheduler or something similar. I found this pdf on the Safe website of a Conterra webinar. On page 11 (Sample #2), they show how you can call an FME workspace from a Python script using the following code:
import os
os.system('fme.exe AnyWorkspace.fmw \
--SourceData AnySource \
--DestinationData AnyDest \
--AnyParam ParamValue')
The questions posted here and here might also be of assistance.
Turns out, I didn't need to use a VariableRetriever or VariableSetter transformer. I first create the attributes that will hold the bounds:
Then I pass that to the PythonCaller and expose those attributes. The code looks like this:
import fmeobjects
import csv
# Template Function interface:
def getBounds(feature):
global XMIN
global XMAX
global YMIN
global YMAX
outputDirectory = FME_MacroValues['Output_Directory']
csvPath = outputDirectory + '\\Buffer Bounds.csv'
coordlist = []
with open(csvPath, 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter = ',')
bounds = reader.next()
XMIN = float(bounds[0])
XMAX = float(bounds[1])
YMIN = float(bounds[2])
YMAX = float(bounds[3])
feature.setAttribute("_xmin", XMIN)
feature.setAttribute("_ymin", YMIN)
feature.setAttribute("_xmax", XMAX)
feature.setAttribute("_ymax", YMAX)
print XMIN, XMAX, YMIN, YMAX
pass
# Template Class Interface:
class FeatureProcessor(object):
def __init__(self):
pass
def input(self,feature):
self.pyoutput(feature)
def close(self):
pass
And the dialog box looks like this:
I can then pass those attributes as parameters to other WorkspaceRunners.
Now, my workspace runs in minutes instead of 2.5 hours.
Best Answer
Your code seems incorrect. Try:
And just as a warning (from API docs):
The zip file can be made to extract files to anywhere on your hard drive, and z.extractall() will oblige. Very dangerous if you don't know the source.