I'm developing an arcobjects 10.4.1 custom GeoProcess (fusion shift) which has to be able to run within a model builder. The GeoProcess seems to run smoothly, but the problem is it needs to be outputting a resultant feature class that needs to be reused afterwards. The resultant feature class path is being generated correctly and the feature class is there at the end, but the node doesn't turn green nor shades, so it cannot be reused.
This is the code i'm using to statically define this resultant feature class field:
outputParameter = new GPParameterClass();
outputParameter.DataType = new GPFeatureLayerTypeClass();
outputParameter.Value = new GPFeatureLayerClass();
outputParameter.ParameterType = esriGPParameterType.esriGPParameterTypeDerived;
outputParameter.DisplayName = "Resultant feature class";
outputParameter.Name = "ResultantFeatureClass";
outputParameter.Direction = esriGPParameterDirection.esriGPParameterDirectionOutput;
outputParameter.AddDependency("ShiftedWorkspace");
outputParameter.AddDependency("ShiftedFeatureClassName");
IGPFeatureSchema outSchema = new GPFeatureSchemaClass();
outSchema.FieldsRule = esriGPSchemaFieldsType.esriGPSchemaFieldsNone;
outSchema.FeatureTypeRule = esriGPSchemaFeatureType.esriGPSchemaFeatureFirstDependency;
IGPSchema schema = outSchema as IGPSchema;
schema.GenerateOutputCatalogPath = true;
outputParameter.Schema = (IGPSchema)outSchema;
parameters.Add(outputParameter);
And this piece of code is executed once in the update parameters method:
// Output parameter feature class
IGPParameter3 gpParamOutputMasterLayer = (IGPParameter3)m_Parameters.Element[++parameterCount];
IGPParameterEdit3 gpParamOutputMasterLayerEdit = (IGPParameterEdit3)gpParamOutputMasterLayer;
if (!gpValue.IsEmpty()) gpParamOutputMasterLayerEdit.Value = m_GPUtilities.UnpackGPValue(gpValue);
What am I missing? is there something else I need to define?