Select to view content in your preferred language

Can derived outputs be optional?

2196
0
11-03-2015 03:28 AM
JonMorris2
Frequent Contributor

I'm working on a multi-step geoprocessing service where the outputs of some steps are inputs to others. Most of the outputs are rasters, with one or two feature classes. Some are optional, depending on the input parameters.

Everything runs ok in ArcGIS Desktop and I've published the services to my local ArcGIS Server. When I call the services with javascript API, the job runs ok, I get the Succeeded message, then there's an error that the data value is invalid. I think it's still trying to return a dataset, even though my script has skipped the arcpy.SetParameter line (as I am not expecting an output for these particular input settings).

Do I have to make my outputs Optional instead of Derived to avoid this error?

Here's an example of log output:

Submitted.

Executing...

Executing (LFP MODELLING 05 LSAR): lfp05LSAR Plei NO "10. Getech LSARzpd (unpublished Eq.)" NO 0 NO 0 NO 0 Replacive MAX 90 48 2.67 72 NO "Absolute Value" 0 0 d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Z.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Distance.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\NPP.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Bathymetry.tif

Start Time: Tue Nov 03 16:00:08 2015

Executing: lfp05LSAR Plei NO "10. Getech LSARzpd (unpublished Eq.)" NO 0 NO 0 NO 0 Replacive MAX 90 48 2.67 72 NO "Absolute Value" 0 0 d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Z.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Input_Distance.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\NPP.tif d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\Bathymetry.tif

Start Time: Tue Nov 03 16:00:08 2015

Running script lfp05LSAR...

Calculating Linear Sedimentation Rate

Completed script lfp05LSAR...

Succeeded at Tue Nov 03 16:00:11 2015 (Elapsed Time: 2.26 seconds)

Succeeded at Tue Nov 03 16:00:11 2015 (Elapsed Time: 2.29 seconds)

Invalid return value: d:\arcgisserver\directories\arcgisjobs\test\lfp05lsar_gpserver\j9058cc71db094dd18c59e3fc24af6323\scratch\scratch.gdb\Maas_LSARapex

Failed.

You can see the input rasters are being read from the scratch workspace ok, but after the job has supposedly succeeded, the server attempts to return an optional dataset, which is not present in the gdb.

I've actually edited my script to save any old rubbish to the database then call arcpy.SetParameter for each of the optional outputs. Then the service completes its run without error. It would be nice if I didn't have to do such a hack though.

0 Kudos
0 Replies