Can a 10.1 geoprocessing task get ahold of an IMap or Map Document object?

Discussion created by on Mar 1, 2013
I have .NET classes that use ArcObjects for network analysis which we've used with Desktop tools and in ArcGIS Server 9.x - 10.0 via the Web ADF.

Now I'm trying to wrap it up so it is usable with 'modern' 10.1 ArcGIS Server as a Geoprocessing Task - either as an SOE or as a Toolbox tool. The latter seems like less work.

Either way, one of the necessary inputs is an IMap object, for the PointToEID CoClass's SourceMap property.

'ArcMap Document' (DEMapDocument in .NET) is a GP parameter data type, I could use that, and get the IMap from it. I suspect that would force the task to spool up that document with every execution, however. Am I wrong?

If this was a Desktop python Toolbox tool, for example I'd do this:


rather than this:


to reference the current document. But at least at 10.0, one couldn't use "CURRENT" on ArcGIS Server.

We are just migrating from 10.0 to 10.1, the publishing scheme has changed alot, so forgive some ignorance. I'm clear how publishing from a Result gives the tool access to layers without having to spool them up with each execution of the task, like a 'tool layer' gave you at 10.0. I'm not clear whether the same extends to the map document itself, or the syntax involved.