jketola

Batch problem: multivalue feature/raster datasets and value update

Discussion created by jketola on Jun 28, 2011
I am having few weird issues with our tools batch execution. The tool is actually a wrapper for multiple tools and currently implements IGPFunction2 - before was IGPFunction but the change did not help to any of the issues. The problems exists in both arc10 and arc9.3 (or at least in arc10).

1. problem in batch
When the tool is having multivalue parameter for rasters or features (maybe others but these would need catalog path not just as string) the typecast to IGPMultiValue returns null. I.e.

IGPParameter gpParameter = paramvalues.get_Element(i) as IGPParameter;
IGPMultiValue multiValue = gpParameter.Value as IGPMultiValue; <- this one is null in batch execution otherwise it works as supposed. Is there any reason for this or some workaround?

2. problem in batch
When tool should update default value for some parameter I'm getting an COMException - this also happens only in batch execution. Update is now done within UpdateParameters, before it was done in Validate that had true for the updateValues parameter (which should mean that changing values and enable/disable state is allowed).

Changing enable and disable state is working, but

IGPParameter3 gpParameter3 = paramvalues.get_Element(i) as IGPParameter3;
gpParameter3.Value.SetAsText(p.Value.AsString); <- this one is throwing COMException in batch

Currently i'm handling it by catching the comexception and ignoring it which results that the tool works but are missing the updated default values.

Outcomes