RowChangedEvent or RowCreatedEvent not firing on Split tool in Branch version

409
3
11-23-2021 09:46 AM
JimmyBowden
Occasional Contributor II

I have a need to detect when a split occurs so that I can get a new custom ID and update a database that is outside ArcGIS.  This code works fine when using an Enterprise geodatabase.  However when I execute a split against a utility network branch version layer the events never fire but the split operation completes successfully.  Using fiddler I was able to see that the applyEdits is sending a "splits" object as opposed to "updates" or "creates".

private Dictionary<string, List<SubscriptionToken>> _rowevents = new Dictionary<string, List<SubscriptionToken>>();
foreach (var fl in ActiveMapView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>())
{
    var fc = fl.GetFeatureClass();
    var tokens = new List<SubscriptionToken>();
    tokens.Add(RowCreatedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
    tokens.Add(RowChangedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
    tokens.Add(RowDeletedEvent.Subscribe((rc) => RowEventHandler(rc), fc));
    _rowevents[fc.GetName()] = tokens;
}

private void RowEventHandler(RowChangedEventArgs rc)
{
    //Never fires when a split
}

 

3 Replies
KrisCulin
Occasional Contributor

Have you looked into handling EditStartedEvent and EditCompletedEvent instead of the row events?  They might provide you what you need.

The details on how to use them are on the github wiki for the AGP SDK.

Kris

0 Kudos
JimmyBowden
Occasional Contributor II

Yes I am aware of those methods but I need to modify the features.  Those methods don't provide the same granular access to rows.   To clarify I need to set an organization id on the feature then use that ID to write to an external data repository.  

0 Kudos
DrewDowling
Occasional Contributor III

Did you every find a solution to this? I have a similar issue with RowChangedEvent not firing for any edit on a branch versioned feature service. RowChangedEvent and RowDeletedEvent work fine.

0 Kudos