Skip to main content

Hi,

I have just tried to use the snippet supplied by Safe to run a Workbench from python and i get the following error

TypeError: descriptor 'runWithParameters' requires a 'fmeobjects.FMEWorkspaceRunner' object but received a 'str'

This is my code so far up to the point where these is the error:

#initiate FMEWorkspaceRunner Class

 

runner = fmeobjects.FMEWorkspaceRunner

 

 

#Full path to Workbench

 

workspace = r'C:\\Avoidance_Areas\\shape2acad2016.fmw'

 

 

#Set workspace parameters by creating a dictionary of name value pairs

 

parameters = {}

 

parametersr'SourceDataset_SHAPE'] = Avoidance_Area_shp

 

parametersa'DestDataset_ACAD'] = r'C:\\Avoidance_Areas\\Avoidance_Areas.dxf'

 

 

# Use Try so we can get FME Exception

 

try:

 

# Run Workspace with parameters set in above dictionary

 

runner.runWithParameters(workspace, parameters)

Can anyone tell me why its having this issue as im following the supplied code template.

Try with paranthesis at the end:

runner = fmeobjects.FMEWorkspaceRunner()

They are the difference between returning a class reference (without paranthesis), and returning an instance of the class (with paranthesis).

Notice the paranthesis here as well.


Try with paranthesis at the end:

runner = fmeobjects.FMEWorkspaceRunner()

They are the difference between returning a class reference (without paranthesis), and returning an instance of the class (with paranthesis).

Notice the paranthesis here as well.

Thanks David - looks like that helped but now im getting the 

FMEException: 896902 ... i will have to inveistgate why this is the case. 

 


Reply