Skip to main content
Question

Invoking a separate workbench from python caller

  • May 26, 2013
  • 2 replies
  • 61 views

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

 

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.

2 replies

takashi
Celebrity
  • May 26, 2013
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

david_r
Celebrity
  • May 27, 2013
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