2

After publishing the Reconcile Versions GP tool to ArcGis server 10.1, it can be successfully invoked via REST but only on versions existing at the time the service was published. If a new version is created the service fails. The error is:

ERROR 000622: Failed to execute (ReconcileVersions). Parameters are not valid.\nERROR 000800: The value is not a member of...(list of version names)

Is there some way to publish this tool so it can reconcile versions that are created dynamically?

3

Yes, you can publish this tool so it can reconcile versions that are created dynamically. You need to add a couple other tools to the model though. Most of the tool parameters can/should be model parameters, this will give you the most flexibility.

  1. You should not use a parameter for the sde connection since this will be a connection on the server.
  2. The parent version can be a model parameter. If you will always be using default as the parent, then no special handling is required since this will always be in the choice list for the gp service. If you want to specify a version that does not exist yet, use the Collect Values tool as described in point 3.
  3. For the edit version(s), you can add a "Collect Values" (Model only tool), set this tool to accept a model parameter collection of string values and direct the output to the Reconcile Versions Edit Versions parameter. The Collect Values tool will separate the parameter from the Reconcile Versions tool and allow you to send whatever value(s) you want to the tool.
  4. Acquire Locks, Abort On Conflict, Conflict Detection, Post and Delete can/should all be model parameters.
  5. Optionally create a log file, you can just provide a name and ArcGIS Server will automatically put this in scratch space. If you then use a Python script to read this file, you can return the contents of the log in the tool messages as output so the calling application can get the results.

Graphically, it might look like this: ReconcileVersions Server GP Tool

The ReadFile script might look something like this:

# Import arcpy module
import arcpy

# Script arguments
theFile = arcpy.GetParameterAsText(0)
if theFile == '#' or not theFile:
    theFile = "LogFile.txt" # provide a default value if unspecified

with open(theFile) as f:
    content = f.readlines()

arcpy.AddMessage(content)

Finally, in the Catalog tree, select the ReadFile script and add the 2 parameters ("theFile", File, Required, Input, Not Multivalue; and "content", String, Derived, Output, Multivalue).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.