I'm trying to port an ArcMap extension to Pro and can't find the event I need. The old code uses OnStopEditing to know when an edit session is saved, at which time it enumerates the committed row inserts, edits, and deletes, and notifies an external application of the changes. The Pro SDK seems only to have EditCompletedEvent, which fires after each individual edit operation. The problem is the user could undo the edit operation or discard it by not saving the session, in which case the external app must not be notified of the change.
So is there any way in Pro to detect the edit session is being saved, and get a list of the committed changes (features affected, before and after values, etc.)?
Solved! Go to Solution.
Hi Mark,
The start and stop editing events from ArcMap have not been exposed in Pro in the current version.
You can get information on row events within an edit session through the row changed events, but in your case it could be moot without knowing the edit session boundaries.
The row changed event args return a row that can be queried for properties such as HasValueChanged and GetOriginalValue. In ArcMap I presume you use the IDataChangesEx Interface?
We’ll look at these events in a future release. Are there any other editing events your extension relies on?
Hi Mark,
The start and stop editing events from ArcMap have not been exposed in Pro in the current version.
You can get information on row events within an edit session through the row changed events, but in your case it could be moot without knowing the edit session boundaries.
The row changed event args return a row that can be queried for properties such as HasValueChanged and GetOriginalValue. In ArcMap I presume you use the IDataChangesEx Interface?
We’ll look at these events in a future release. Are there any other editing events your extension relies on?
Hi Sean,
Thanks for you quick response. Here are the session-level events we're using in ArcMap:
Besides the session-level events, our ArcMap extension also uses row-level events to validate feature attributes real-time and do some on-the-fly conflict resolution.
I can understand this is all probably above and beyond what a typical Pro add-in is expected to do. But without this level of capability in the Pro SDK, we'll just have to hold off on porting our extension to Pro.
-Mark
Has there been any progress on extending the on start editing to Pro?
Not directly but a few things have been added to 2.3
ArcGIS.Desktop.Editing.Events.EditCompletingEvent is the equivalent OnBeforeStopOperation
ArcGIS.Desktop.Core.Project.EditedDatastores returns the data stores (workspaces) that have pending edits which have not been saved.
ArcGIS.Desktop.Editing.Events.EditCompletedType now includes post and reconcile.
The OnStopEditing equivalent would be the EditCompleted event where the EditCompletedType would be either save or discard. Both of these stop the edit session. EditCompletedEventArgs provides the changes during an individual editoperation. Additionally the rowevents will also fire during the operation.
There's no equivalent for OnStartEditing. An editoperation will start an edit session if there isnt one already going during Execute but it wont know whats changed until its completed.
The IDataChanges equivalent is in progress.
Conflict support is currently limited.
So for the edit operation, Will the edit session be able to fire something to let us know a user is starting to edit a version? I ask because there are things we check for when a user tries to start editing.
Hi Jordan,
Without a formal start editing experience the best place to do this for custom tools would be the tool activation event. You could do your layer checks there and message appropriately.
For core tools such as reshape its trickier. You would have to listen to row changes on the layer(s) then work out the version and cancel the edit if it wasn't correct. Unfortunately to the user it looks like they can do the edit, until it fails. Rather than listening to row events, one thing we can add here for 2.4 is more information on whats about to happen in the editcompleting event, being the list of layers and features being edited but before the commit.
I realize this is an older post, but I am trying to do something very similar, if not the same as Mark. I am trying to port over an ArcObjects extension which also listens for OnStartEditing and OnStopEditing. When an edit session begins, many checks happen including figuring out the layers in the map and if the appropriate datastores are connected to those layers to trigger certain things through the edit session. Having the ability to know when to begin listening for all these things would be super helpful with an OnStartEditing event listener.
The issue with the tool activation event is what if a user does something to a geometry without activating the tool? The extension I am porting over listens for geometry changes too in which an OnStartEditing event listener would be able to prepare for.
One possibility I am thinking through is to listen for the esri_editing_editingCurrently and esri_editing_editingNotAvailable states. If I could be notified of these states being in the ArcPro session, I could use them like the OnStartEditing and OnStopEditing events. The issue is, I'm not sure where to check if these states are in the current ArcPro session. Is there an event to subscribe to in which I can check for these states continuously?