Configuring tasks

You will define the GIS functionality in your web applications by selecting and configuring tasks. Tasks encapsulate specific functionality for your application, such as querying or editing. Manager includes the following set of tasks that initially populates the list of available tasks:

The Editing and Geoprocessing tasks are valid only with ArcGIS Server services. Other tasks can work with multiple types of services. For example, the Search Attributes task can search the attributes of layers from ArcGIS Server, ArcIMS, and ArcWeb services.

You can also use the developer libraries included with the Web ADF to create custom tasks. See the discussion Working with tasks in the Developer Help for more instructions.

Some tasks require that you define supporting services in order for them to run. For example, the Find Address task requires you to select an existing ArcGIS Server geocoding service, an ArcIMS service enabled for geocoding, or an ArcWeb Service that can geocode. You can select these services in the Supporting Services tab.

For each task that you add to your application, a Configure button is available that lets you customize the specific look and behavior of the task. In many cases this involves selecting the layers and fields that you want the task to work with. If you want to see field aliases appear in the task, or if you want to hide certain fields, you should configure these settings in the map document (.mxd) before you create the task. The Layer Properties dialog in ArcMap contains a Fields tab where you can hide fields and set field aliases. You must start and stop the map service in order for these changes to appear.

The following sections describe the available tasks in more detail.

Editing task

The Editing task provides a suite of tools for Web-based editing of features and attributes in ArcSDE geodatabases. This task requires that your application contain a map service accessed through an ArcGIS Server Local connection that includes at least one layer from an ArcSDE geodatabase. Shapefiles, personal geodatabase, and file geodatabase layers are not editable, however you can include these types of layers in the map service.

What can I do with the Editing task?

When you add the Editing task to an application, users of that application will be able to access various tools to edit data and save their edits. The Editing task includes tools for creating, moving, copying, splitting, merging, and deleting features. Additionally, you can view and edit the locations of feature vertices. When you configure the Editing task for your application, you can select which versions and layers users will be able to edit. When editing, users of your application can adjust the snapping and selection options.

Editing in the Web environment has a slightly different feel from desktop editing, and you may want to use a practice dataset to accustom yourself to the available tools and their behavior. For instance, when editing with snapping enabled, you will not see the snapping occur on the screen until after you place the vertex. The placed vertex will be snapped to the appropriate vertex, edge, or end. (Note: To see the snapping tolerance, check the "Show snap circle" check box, and to see where the current cursor location will snap to, press the "s" key.)

How do I use the tools contained in the Editing task?

You can find detailed help about each tool in the Editing task by clicking the Help button in the upper-right corner of the Web Mapping Application. The "Editing Data" page contains graphics and instructions for using all of the tools contained in the Editing Task.

Is the Editing task customizable?

Beginning at ArcGIS Server 9.2, Service Pack 2, the Editing task is customizable. See the Editor Task control discussion in the Developer Help for samples and instructions on how you can add your own functionality to the Editing task.

You can also customize the Web Mapping Application Help to document any tools you add to the Editing task. The help file for the “Editing data” topic is located in C:\Inetpub\wwwroot\<Application name>\Help\EditorTask.htm. You can use any text or HTML editor to modify this topic with a description of your customized Editing task.

Editing with pooled and non-pooled services

Prior to ArcGIS Server 9.2, Service Pack 2, the Editing task was only available with non-pooled map services. At Service Pack 2, you also have the option to use the Editing task with pooled map services. When you use pooled services, your server can support a larger number of concurrent users because the server does not have to create a dedicated service instance for each user during his or her application session. Instead, users can share service instances from a pool. Before you implement the Editing task with a pooled service, you should be aware of the following:

Editing versioned and non-versioned data

The Editing task supports editing versioned and non-versioned data. To edit versioned data with the Editing task, you must be using a non-pooled service.

You can edit non-versioned data with either pooled or non-pooled services. When editing non-versioned data, you cannot undo or redo edits or adjust the auto-reconciliation options. The last edit to be saved always overwrites any previous edits to the same feature.

How are conflicts resolved?

What happens when two users edit the same feature at the same time using the Editing task? The Editing task auto-reconciles any conflicts based on two important settings:

By default, conflicts are resolved by object (row) in favor of the database. If you want different settings, click the Configure button for the Editing task in Manager, then click the Advanced tab to set the auto-reconciliation options.

You can define how conflicts are reconciled by using the Advanced tab in the Editing task configurator.

You can also choose whether users will receive a message when attempting to save a conflicting edit. The message reads: “The target version has been updated since you started editing. While merging these changes into your edit session, conflicts were detected and resolved.” You can see the changes from others' edits when the map refreshes.

Additional information about the Editing task

Following is some additional information that you should know about the behavior and abilities of the Editing task:

Find Address task

The Find Address task prompts the user for an address, then displays the resulting address on the map. It can be configured with an ArcGIS Server geocode service, an ArcIMS service with geocoding enabled, or ArcWeb Services.

For ArcGIS Server, the Find Address task is based on a locator. Once you add a Find Address task to your Current Tasks list, you need to specify the locator using the Supporting Services tab. The number of input boxes and the text you see in the user interface for the Find Address task comes from the locator itself. You can change the text by opening the locator (.loc) in a text file before publishing it to the server. Changing it in the locator, however, will also change how the text appears in ArcGIS Desktop.

  1. Navigate to the location of the locator.
  2. Edit it in a text editor.
  3. Search for the text "FieldAliases." For instance:

    FieldAliases = Zone

  4. Edit the field alias. For example, you might change Zone to ZIP Code.

    FieldAliases = ZIP Code

For more information on locators, see the ArcGIS Desktop Help.

If you are using ArcIMS, you must select a layer with a geocode extension, and then configure the task.

  1. Click the Supporting Services tab to see a list of services that include the geocode extension.
  2. Select the service layer you wish to use, and click Add.
  3. Click the Select Tasks tab.
  4. Select the Find Address task, and click Add.
  5. Select the task in the Current Tasks list, and click Configure.
  6. In the dialog:
    • Change the title name, if desired.
    • Type a tool tip, if desired.
    • Confirm the GeocodeResource is correct. It sould be the layer name you selected earlier.
    • Change the button text, if desired.
    • Leave the defaults for TaskResultsContainer and GeocodeResourceManager.
    • Click Apply.

Find Place task

The Find Place task allows a user to type in the name of the place to search for on the map. The application accesses an ArcWeb Service to search for the place name entered by the user, who can then highlight the resulting places on the map.

To configure the Find Place task, you need to provide information about how you want the task to be displayed, how it will connect to ArcWeb Services, the places it will search for, and how the results will be returned.

The Find Place task does not support custom lists of places.

Geoprocessing task

With the Geoprocessing task, you can make use of services that run ArcGIS geoprocessing jobs on the server and send the results back to the client application. The Geoprocessing task requires an ArcGIS Server geoprocessing service, which you specify using the Supporting Services tab. Geoprocessing services are based on models and can be published from either a toolbox or a map document containing a tool layer. See the topic Geoprocessing services for more information on how to create a geoprocessing service.

Configuring the Geoprocessing task

When you add a Geoprocessing task to your application in Manager, remember these required steps:

  1. Use the Supporting Services tab to select a geoprocessing service that will be associated with the task.
  2. Switch back to the Select Tasks tab, and under the list of Current Tasks, click the Geoprocessing task. Then click the Configure button to access the Task Configuration dialog.
  3. In the Task Configuration dialog, set the Task Definition by expanding the geoprocessing service and selecting one tool from it. This is the tool that will be associated with this Geoprocessing task. To make other tools available, you can add other Geoprocessing tasks.
  4. The Task Configuration dialog also has a setting for the virtual directory where the result data file will be written. The value you enter here will be set as the VirtualDirectory property of the Geoprocessing task. The account running the application must have Read and Write access to this directory.  

Running the Geoprocessing task and working with results

When you open a Geoprocessing task, you will see a dialog that allows for specification of the model parameters. For example, if the underlying model requires a line feature class as input, the dialog will include tools for drawing lines. Once you've specified all of the parameters, you can then invoke the model by clicking a button on the task. As the job runs, you can see any messages from the task in the Results panel. When the task has completed, the results will appear on the map if one of the following conditions is met:

Geoprocessing services have a property that determines whether they run synchronously or asynchronously. If the service is configured to run asynchronously, you have the option to view the task results even after closing the web application. If the task has not finished executing before you close the browser, and if you have cookies enabled, the results will be retrieved automatically next time you visit the web application. Otherwise, you can click the Save link on the results node to save the result information to a file. You can use this file to check task results in a later session. The Save link is only available if the VirtualDirectory property of the Geoprocessing task is set (This property is mentioned in Step 4 above). If the service is configured to run synchronously, no Save link appears and you must keep the session alive in order to view the results when they become available.

The results of a Geoprocessing task can either be drawn on the server or by the Web ADF. If the result is drawn by the Web ADF, you will be able to zoom and pan to the results, and will see the results listed as individual features. By default, the results will be drawn by the Web ADF unless the geoprocessing service that you used to configure the task has an associated map service, in which case the results will be drawn on the server. You can change this behavior in Visual Studio by setting the task’s DrawResultsOnMapServer property to "False".

Further help with the Geoprocessing Task

The tutorial Publishing a geoprocessing service includes steps for configuring the Geoprocessing task and working with it in a Web application. The tutorial starts with building a model in ArcGIS Desktop, then works through the process of publishing the model as a geoprocessing service and configuring the Geoprocessing task so that the model can be run within a Web application.

Query Attributes task

The Query Attributes task helps users select or view certain data on the map, based on that data's attributes. A Query Attributes Task creates a single query on one map layer. However, the query may have compound criteria. For example, you can define a query on a cities layer that selects cities with a population greater than a value entered by the user, and with a name that begins with a value entered by the user.

When you configure the Query Attributes task, you create an easy-to-understand form that will guide the user through the process of making the query. This way, users of your application will not have to know the details about the dataset, nor will they have to construct a Structured Query Language (SQL) statement, in order to query the data.

For example, suppose you wanted users to select U.S. counties by entering a state name and a minimum average household size. A SQL expression for this selection might look something like this: "SELECT * FROM counties.sdc.counties WHERE: "STATE_NAME" = 'Idaho' AND "AVE_HH_SZ" > 3.0. The users of your Web application might not know the field names of your data, or how to write a SQL statement. You can help them by using the Query Attributes task to create an easy-to-read form with text like the following: "I want to select counties in the state of: (user picks a state from a dropdown box) whose average household size is greater than or equal to: (user enters a number in a text box)."

When you add a Query Attributes task in Manager remember the following important steps:

Search Attributes task

The Search Attributes task allows a user to enter some text that will be used to search the attributes of the layers on the map. This kind of search is similar to the simple Web search that sites like Yahoo and Google provide. After searching for something, the user can then select, zoom to, or pan to any features in the list of results.

To configure the Search Attributes task, you'll need to specify the display settings, the search fields, and how you want the results to appear:

By default, ArcGIS Server map services limit the number of records returned by a query to 500 records. To change this default behavior, you need to manually edit the configuration file and change the MaxRecordCount property. See the Service Configuration Files topic in the ArcGIS Server Help for more information.

Next topic: Customizing the look and feel of the application