I'm trying to automate the the running of a 2 step process required for multiple admin areas.
My current process is:
1. Workbench with workbench runner kicks of step 1 (for multiple admin areas at a time)
2. Once all admin areas have been processed - redirect workbench runner to point to step 2
Ideally I'd like to have a python shutdown script (or something of that ilk) within step 1, which would process step 2.
Problem - The documentation for python shutdown scripts states you shouldn't use fmeobjects within a shutdown script...however this example highlights that it can be done.
I attempted to follow the example code, but it is dated 2013, so could be redundant to 2015...can anyone assist with:
a. Writing a python shutdown script to kick of new workbench,
b. Can you use fmeobjects withn a shutdown script?
#FME Variables import fme, fmeobjects status = fme.status runner = fmeobjects.FMEWorkspaceRunner() #Path to Workspace current_workspace_dir = fme.macroValues["FME_MF_DIR_DOS"] workspace = current_workspace_dir + "\Workbench2.fmw" def main(): with open("E:\FME_Workbenches\PythonTesting\WorkbenchOne_Status.txt", "w") as text_file: text_file.write("Workbench Status: {}".format(status) + "\n") text_file.write("Workbench directory: {}".format(current_workspace_dir) + "\n") text_file.write("Workbench: {}".format(workspace) + "\n") def workspaceRunner(): runner.promptRun(workspace) main() workspaceRunner() #if status == "True": #main() #workspaceRunner()
Cheers
Hugh