ExecuteGPTask
The Execute Geoprocessing Task (ExecuteGpTask) handler talks to the Geoprocessing (GP) Server that runs on the same server as the feature service where GDBM XI handles all its version management.
This is a powerful way to create a custom process (or GP Task) for feature service data triggered by GDBM activities, such as reconciling and posting versions. Examples of the custom processes are inserting rows into tables, inserting features into feature classes, modifying or deleting rows or features, and running a “version differences” process, to name a few. Almost anything that can be done to data in ArcGIS Server can be automated by a custom GP Task in a GP Server. The ExecuteGpTask handler is the go-between that allows you to program the GDBM processor to run a GP Task available on your ArcGIS Server.
As already mentioned, this handler is pretty powerful, and with great power, comes great responsibility. If you set up an ExecuteGpTask handler, you should already be familiar with authoring and publishing GP tools and have experience invoking published GP tasks through ArcGIS Server.
To set up an ExecuteGpTask handler, you start by creating a new handler as outlined in Add New Handler. After you save the new ExecuteGpTask handler, four Properties appear: GP Server Path, GP Task Name, Abort On Error, and Wait for Result. These properties need additional configuration before the handler is fully configured.
Property |
Description |
---|---|
GP Server Path |
The GpServerPath and GpTaskName properties are used to identify the GP Task that is invoked on the ArcGIS Server by the ExecuteGpTask handler. They help the action handler produce the correct URL for the targeted GP Task so it can invoke the GP Task via ArcGIS Server. You need to manually enter the GPServerPath and the GpTaskName into those Property fields. Note:The GpTaskName cannot contain any spaces between the characters. |
GP Task Name |
|
Abort On Error* |
The AbortOnError property is also populated with a value of true or false. It instructs the GDBM processor whether failure of the GP Task causes GDBM to stop all further processing of the current version (AbortOnError = true), or whether the processing should continue despite the failure of the ExecuteGpTask handler (AbortOnError = false). If you do not populate the AbortOnError property, the ExecuteGpTask handler defaults to a value of false for that property.
IMPORTANT: If a value other than true or false (including an
empty or misspelled value) is used for this property, the behavior
of the property defaults to false.
|
Wait For Result |
The WaitForResult property is populated with a value of true or false. This property tells the GDBM processor whether it should trigger execution of the GP Task on ArcGIS Server and return immediately (WaitForResult = false), or instead wait until the GP Task is completed (e.g., until it succeeds, fails, or times out; WaitForResult = true). If you do not populate the WaitForResult property, the ExecuteGpTask handler defaults to a value of false for that property. |
*The precise interpretation of AbortOnError depends upon which stage the GP action handler is in, within the GDBM Program, as outlined in the table below. The Edit Program topic contains additional information about Programs and their stages.
Stage occupied by the Action Handler in the currently running Program |
Outcome when Action Handler fails and AbortOnError = true |
---|---|
Program Begin (both Rec & Post) |
Stops the whole program. No remaining handlers in the slot fire. Program begins again next cycle, and the handlers then all get another chance. |
Before Reconcile |
Version is not reconciled and no remaining handlers in that slot fire for that version. Reconcile process moves on to the next version. |
Before Post |
Version is not posted and no remaining handlers in that slot fire for that version. Posting process moves on to the next version. |
Conflict Handling |
No remaining handlers in the slot fire for that version. |
Error Handling (both Rec & Post) |
No remaining handlers in the slot fire for that version. |
After Reconcile |
No remaining handlers in the slot fire for that version. |
After Post |
No remaining handlers in the slot fire for that version. |
Program Completion |
No remaining handlers in the slot fire for the program cycle that just ended. |
Most GP Tasks require additional input parameters of some sort. The parameters needed to feed the GP Task everything it might need, including optional inputs, are highly variable and depend upon the design of the GP Tool that was published to ArcGIS Server to become the GP Task. At a minimum, you must add a custom property to the action handler configuration for each required parameter for the GP Task that has not been configured (when the GP Task was published) with a default value, and you must supply a value for each of those parameters in the form that the GP Task expects for them.
You can add additional properties by clicking the Add property button next to Properties. Tokens are supported within property
values if they are used in the GP Tool. See the Tokens topic for a complete list of tokens available for use.