I’m a newbie so please excuse a dumb question; I’m just finding the documentation rather confusing.
Can I use arcpy.da.Editor in a geoprocessing service called by a web app? If I can, how do I determine what the workspace is?
This is the code I’m attempting to use:
edit = arcpy.da.Editor(arcpy.env.workspace)
edit.startEditing(False, False)
edit.startOperation()
// my code here
edit.stopOperation()
edit.stopEditing(True)
The full story is there’s an existing ArcMap addin with a toolbox module. I’m attempting to publish the toolbox as a set of geoprocessing services, which will be called from geoprocessing widgets in a new web app (created with web appbuilder). At the moment, calling any of the geoprocessing service is failing with the error “cannot open workspace”.
It seems logical that there might be some extra set up required before trying to get the workspace; this is a web app, not ArcMap (when used in ArcMap, the workspace comes from a settings file). But I’m not sure if it’s even possible to do what the code is trying to do. Because this is an existing (unfamiliar!) codebase, I’m also trying to minimise the changes and identify if the code needs to diverge in order to support the web app.