SOI on applyEdits of FeatureService

1279
5
10-11-2018 06:59 AM
KarenRobine
Occasional Contributor II

I'm wondering if it's possible to capture applyEdits of a Feature Service using an SOI?  Here's the Rest request I want to intercept:  https://developers.arcgis.com/rest/services-reference/apply-edits-feature-service-.htm

But more importantly, I would like to integrate my code in the middle of the edit session.  So when doing the edits within an Edit Operation, I want to call other checks. If the checks fail, I need to basically undo the edit operation, and pass back an error message stating it failed.  There is a (non-working) example in the SOE samples of basically applying edits using an SOE.  So I think I can probably write my code in the middle of this.  But that would require me to essentially write all the code that is part of featureService/applyEdits. I was hoping to avoid this.  Ideas?

Thanks.

5 Replies
JadeFreeman
Occasional Contributor III

Did you find a solution to this?  We would like to do the same thing.  

0 Kudos
KarenRobine
Occasional Contributor II

Yes. You have to do it as a SOE.  You need to run it against the Map Service, not Feature Service. You'll have to essentially reprogram the ApplyEdits REST endpoint. I got it working great, and even added topology checking in the middle of it and provide the ability to undo edits if topology fails.

0 Kudos
KarenRobine
Occasional Contributor II

Also, last time I checked, the sample online was buggy.

0 Kudos
VishApte
Esri Contributor

H Karen,

Can you please share more details about SOE? I have requirement with Utility Networks topology to validate the adds and updates with third-party Enterprise Asset Management system. This includes obtaining "asset id" for any new objects such as pipe etc. from the EAM system and then continue with applyEdits. I was hoping to build it using SOI. 

Cheers,

Vish

0 Kudos
KarenRobine
Occasional Contributor II

If you want to do it in an SOI, you wont be able to undo edits because the SOI occurs before (or after, I can't remember), it gets to the actual edit.  I did mine in an SOE so that you can perform the following: start an edit session; check topology before the edit occurs; perform the edits; check topology after the edits; and then either cancel the edit session (undo edits), or continue/save the edits (depending upon which option the user chooses), and pass back topology errors if there are any.  It'll help to fully understand how ArcObjects deals with edits. Then simulate that.  I had to duplicate many of the ApplyEdits functions in a Feature Service as well in order to pull this off since only Map Services can handle SOEs.  


Karen

0 Kudos