Ticket #50 (closed Defect: fixed)

Opened 6 years ago

Last modified 6 years ago

OverriddenByArcGISGeoprocessorVariable design for overwriteExisting parameter is flawed

Reported by: jjr8 Owned by: jjr8
Priority: Medium Milestone: 0.1
Component: Core - Other Version: null
Keywords: Cc:

Description (last modified by jjr8) (diff)

The intent of the OverriddenByArcGISGeoprocessorVariable was to allow method parameters to be overridden by ArcGIS environment settings, ignoring whatever the caller supplied for the parameter. But there is a problem with this approach.

It works fine for methods that do not use the ArcGIS geoprocessor. In this situation, the geoprocessor will not have been initialized and thus the override will not occur. But methods that do use the ArcGIS geoprocessor cause it to be initialized as a dependency. Then, when the parameters are validated, they are overridden. This happens even when the user invokes the method from a script, completely outside of the ArcGIS user interface.

As a result, the caller's values for certain parameters are always ignored. For example, in the HDF.SDSToArcGISRaster method, the overwriteExisting parameter is always set to gp.OverwriteOutput, no matter what.

This design needs to be rethought.

Change History

Changed 6 years ago by jjr8

  • description modified (diff)

Changed 6 years ago by jjr8

  • status changed from new to closed
  • resolution set to fixed

Fixed in [65].

Renamed OverriddenByArcGISGeoprocessorVariable to InitializeToArcGISGeoprocessorVariable. Changed the design such that any parameter flagged with that is only initialized to the specified variable when the method is invoked as an ArcGIS tool. In all other circumstances (e.g. Python, COM) the caller is responsible for setting the variable explicitly.

Note: See TracTickets for help on using tickets.