As described in A quick tour of authoring and sharing geoprocessing services, authoring a geoprocessing service entails authoring the tasks within the service. Authoring a task means selecting or creating a tool, defining the input and output parameters of the task, and the location of any data used by the task. More often then not, you create tasks by sharing custom tools created with ModelBuilder or Python.
ModelBuilder is an application you use to create, edit, and manage models. Models are workflows that string together sequences of geoprocessing tools, feeding the output of one tool into another tool as input. ModelBuilder can be thought of as a visual programming language for building workflows. Models and ModelBuilder are an easy way to author geoprocessing tasks.
If you are unfamiliar with models and ModelBuilder, skip to the Getting started with ModelBuilder section below for a list of useful topics.
If you have an existing model with parameters that you can run successfully in ArcGIS for Desktop, you can share it in a service without modification. The remainder of this topic addresses some of the finer points of authoring tasks with ModelBuilder.
Creating results from models
Services are created by right-clicking a result in the Results window. In order to create a result, a model must be run as a tool, either by opening its dialog box from the Catalog or ArcToolbox window, or running it in the Python window.
In the vast majority of cases, your model will need to have parameters. You can see an example of a model tool with parameters in A quick tour of authoring and sharing geoprocessing services. You can learn more about creating model tools in the topic A quick tour of creating tools with ModelBuilder.
Intermediate data is data created by the model but is not an output of the model. Intermediate data created by a task is automatically deleted by ArcGIS Server.
Writing output data to in_memory
One technique you can use to increase performance is to write intermediate and output data to the in_memory workspace.
Learn more about the in_memory workspace
When you use result map services, it is important to realize that there are two services—the geoprocessing service and the map service. These two services execute independently of each other. When the task executes, ArcGIS Server executes the geoprocessing task first, then executes the map service to draw the output of the geoprocessing task. Because of this execution order, the result map service needs datasets on disk produced by the geoprocessing task. This means that the output of the tasks in the geoprocessing service must be datasets on disk, not in_memory datasets.
Differences between 10.0 and later versions
If you authored geoprocessing services in 10.0, there were specific ModelBuilder techniques you used to author services, noted below. You no longer need to use these techniques in 10.1 and later versions.
Getting started with ModelBuilder
If you are unfamiliar with ModelBuilder, the table below lists a few topics that will help you get started writing models.
Basic concepts of creating your own geoprocessing tools.
These three topics introduce ModelBuilder.
This tutorial shows the basics of connecting tools and data together in ModelBuilder to create a model.
This tutorial shows the basics of creating a tool with ModelBuilder. A model tool is a model that exposes variables as parameters that appear on the tool dialog box when the model is run as a tool. You need parameters in order to create tasks. The other two topics show how to create model parameters.
A quick tour of filtering parameter values
You can create your own choice lists for model variables using value list filters. Choice lists are a great way to present options (choices) to clients of your task.
This topic introduces you to advanced techniques that you may have cause to use when authoring your task with ModelBuilder.