Question

error calling FMEWorkspaceRunner class in python

  • 20 February 2015
  • 5 replies
  • 4 views

Badge
I am trying to use the RunWorkspace script that was posted on here in the knowledge base, so a workspace could be run from a python script. I keep getting an error on the line that initializes the FMEWorkspaceRunner object: runner = fmeobjects.FMEWorkspaceRunner(). The error is: fmeobjects.FMEException: FMEException: 896902:. I couldn't find any information on what that error means specifically. What could be wrong?                

 

 

 

5 replies

Userlevel 2
Badge +17
Hi,

 

 

I suppose you have referred to this article. 

 

Run an FME Workspace from Python using FMEWorkspaceRunner (http://fmepedia.safe.com/articles/Samples_and_Demos/Run-an-FME-Workspace-from-Python-using-FMEWorkspaceRunner)

 

 

I'm not sure what the error code "896902" means, but found the script example in the article has an issue. Each back slash in every string literal has to be escaped, or the literals should be added "r" to the head, like this.

 

 

workspace = 'C:\\\\FMEData2014\\\\Workspaces\\\\DesktopBasic\\\\Exercise1a-Complete.fmw'

 

or

 

workspace = r'C:\\FMEData2014\\Workspaces\\DesktopBasic\\Exercise1a-Complete.fmw'

 

 

See here to learn more about this.

 

The Python Language Reference > 2. Lexical analysis > 2.4. Literals (https://docs.python.org/2/reference/lexical_analysis.html?highlight=literal#literals)

 

 

Takashi
Userlevel 2
Badge +17
But you got the error during initialization of the FMEWorkspaceRunner object.

 

It could be caused by your environment - FME version, Python version, workspace implementation etc.

 

I recommend you to contact Safe support, if it has not been resolved even though you have modified the string literals.
Userlevel 2
Badge +17
or, probably you can see the meaning of error with this code.

 

 

#initiate FMEWorkspaceRunner Class 

 

runner = None

 

try:

 

    runner = fmeobjects.FMEWorkspaceRunner()

 

except fmeobjects.FMEException as ex:

 

    print ex.message

 

    runner = None

 

    exit()
Badge
thanks for the replies. I did notice that about the string literals in the code. However this morning when i ran the code again, without making any changes, it worked. Not sure why.
Badge
Hi Guys

 

We just created an FMEPedia article which deals with some of these issues

 

http://fmepedia.safe.com/articles/Error_Unexpected_Behavior/Errors-FMEWorkspaceRunner-Python-Errors-FMEObjects-Python

Reply