I'm working on an ArcGIS Pro AddIn (in the context of UN). I'm getting null values while inspecting the GlobalID and ObjectID of a RowToken instance (returned from a Create method call on an EditOperation). The RowToken itself is instantiated, but its properties are null. This is an issue because the developer has no options on how to hold a reference for a network element that will be saved (EditOp executed) later in the process.
This only happens when dealing with Group Templates, as the same strategy and source code work for regular templates (sample source coded attached to this message).
I understand that today, this may happen due to the nature of a Group Template—it returns multiple features instead of one. So, which RowToken would be returned?
I have two suggestions for handling this situation. (I'm considering only dealing with FeatureTemplates, and I know that EditOperation.Create deals with a much broader spectrum of entities - please consider the context):
- (non-breaking method signature - this is more of a workaround since it returns partial information about what was created): The Create method of the EditOperation class returns the GlobalID and ObjectID of the Primary builder entity when invoked over a Group Template
- (breaking method signature - this is what I think works semantically correct for regular and Group Templates): The Create method of the EditOperation class returns an enumerable RowTokens instead of a concrete RowToken instance. For regular feature templates, this enumerable will contain a single RowToken instance, while for GroupTemplates, it may contain n RowToken instances, where n equals the number of elements created in the GroupTemplate.
The source code to reproduce the issue is attached to this message for reference.
TestFeatureGroupTemplate.zip