Skip to main content
Hi ,

 

Stuck in a very simple thing it seems . I am trying to call a separate workbench from another by a python caller .Following is the code

 

 

#import fmeobjects

 

import os

 

# Template Function interface:

 

def processFeature(feature):

 

import os

 

os.system("fme.exe MY-WORKBENCH.fmw")

 

 

 

Entry point : processFeature

 

 

 

Error during translation :

 

processFeature

 

2013-05-26 09:26:34|   1.7|  0.0|ERROR |Error executing string `import fmeobjects

 

import os

 

# Template Function interface:

 

def processFeature(feature):

 

import os

 

os.system("fme.exe MBLB-WORKBENCH.fmw")

 

'

 

2013-05-26 09:26:34|   1.7|  0.0|FATAL |Factory proxy not initialized

 

2013-05-26 09:26:34|   1.7|  0.0|FATAL |PythonFactory failed to process feature

 

2013-05-26 09:26:34|   1.7|  0.0|FATAL |PythonFactory failed to process feature

 

 

Please help

 

Hi Roy,

 

 

wrong indentations caused the errors. See documents about the Python language e.g. The Python Language Reference > 2. Lexical analysis (2.1.8. Indentation).

 

 

Why not use the WorkspaceRunner transformer?

 

 

Takashi
Hi Roy,

 

 

if, for some reason, you cannot use the WorkspaceRunner transformer, here is an example of using the fmeobjects API from a Python script. I much recommend this rather than using calls to os.sysytem().

 

 

David

Reply