Skip to main content
Question

error calling FMEWorkspaceRunner class in python

  • February 20, 2015
  • 5 replies
  • 37 views

Forum|alt.badge.img
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

takashi
Evangelist
  • February 21, 2015
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

takashi
Evangelist
  • February 21, 2015
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.

takashi
Evangelist
  • February 21, 2015
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()

Forum|alt.badge.img
  • Author
  • February 23, 2015
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.

Forum|alt.badge.img
  • March 10, 2015
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

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings