Chaining edit operations

420
3
Jump to solution
05-16-2017 09:04 AM
Highlighted
Occasional Contributor III

Using ArcPro SDK 2.0 beta

I see in the Chain Edit Operations sample, we can roll multiple edit operations into one entry in the Undo stack by creating two custom operations.  

Is it possible to get the current edit operation from an out-of-box edit before chaining one or more custom operations to it?(Similar to how the BeforeStopOperation event in ArcObjects functions.)

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

Hi Jeff,

Using the three row events would be the best bet. If the tables you are updating are within the same workspace, the edits will piggyback on the current operation.

View solution in original post

3 Replies
Highlighted
Esri Regular Contributor

Jeff,

With a regular edit operation you create or modify as many features you wish and still have one edit entry on the stack.

The chained edit operation is used when you need the results of an edit to make further edits but still only want one entry on the stack. The example you typically see is creating a feature and adding an attachment in one operation.

Events are limited. EditCompletedEvent fires after an operation. At that point the edit is done and you cant change it or combine with it.

You can listen to the row events (RowChangedEvent, RowCreatedEvent, RowDeletedEvent) which occur during the edit. You can modify the row, cancel the edit or do any number of crazy things here, which will be included in the current operation. Note that GP tools generally don't fire row events.

Whats your workflow with ArcObjects and what are you trying to accomplish?

Highlighted
Occasional Contributor III

Hi Sean,
Thanks for the reply.  

With a regular edit operation you create or modify as many features you wish and still have one edit entry on the stack.

The chained edit operation is used when you need the results of an edit to make further edits but still only want one entry on the stack. The example you typically see is creating a feature and adding an attachment in one operation.

Understood.

Events are limited. EditCompletedEvent fires after an operation. At that point the edit is done and you cant change it or combine with it.

That was my assumption, thanks for confirming.

Whats your workflow with ArcObjects and what are you trying to accomplish?

Several of our current ArcMap extensions use BeforeStopOperation to see what type of operation is being done, and/or in which feature layer the feature resides, before sending some of the edited feature's attribute information off to functions that update non-spatial tables (basically recording edit history, sources, etc.)

Sounds like there are two main options to accomplish this in Pro?

1)  Write customized editing tools which create their own create/update/delete operations and utilize chaining.

2)  Leverage the out-of-box editing tools by subscribing to the three row level events for each feature layer, and handle accordingly inside those events (likely all pointing to the same function).

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Hi Jeff,

Using the three row events would be the best bet. If the tables you are updating are within the same workspace, the edits will piggyback on the current operation.

View solution in original post