Select to view content in your preferred language

Oracle Trigger in a versioned point feature class

776
3
04-22-2019 11:30 PM
Teejay
by
Emerging Contributor

I have a point feature class that I published with feature access enabled with Create, Update and Sync options. 

The feature class has object ID, Global ID, Notification number, notification created date, due date, comments, work order. I enabled keep tracking on edits on the feature class. So it created Created date, created by, last edited date and edited by fields. The feature class is versioned as well.

One of the team that I work with uses applyEdits REST endpoint of the feature service to post data to the feature class.

All they do is insert into the feature class through applyEdits which is on a daily basis. My condition is, if the notification number already exist in feature class, it should update the corresponding values for that particular record. If not, it should insert a new record. 

I tried creating trigger on Adds table from Oracle following this link but I have very limited knowledge on python and oracle. 

https://community.esri.com/thread/113402-sql-trigger-in-versioned-sde

Can someone please point in the right direction how to proceed on about this either using python or FME or any other ways? 

Really appreciate your time and consideration. 

0 Kudos
3 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

The javascript method applyEdits can add, update or delete a feature

applyEdits(adds?, updates?, deletes?, callback?, errback?) - https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#applyedits

In your case I believe would be better to ask from the team using the apply Edits to make a query with the notification number in order to check if already exist in feature class.

  • If a feature exist they can use the ObjectID from the response in order to prepare an applyEdit request for update attributes and/or shape.
  • If not exist proceed to add a new feature.

 

0 Kudos
Teejay
by
Emerging Contributor

Thank you Panagiotis for your answer.

The team using the below endpoint via automated DataPower gateway technology. I'm trying to understand how to use the applyEdits(adds?, updates?, deletes?, callback?, errback?) method for them to query the data before do a insert or update.

server/rest/services/SAPNotification/Notification/FeatureServer/0/applyEdits

Also, the SAP team sending the data, do not have objectID to validate the query. From the feature class, whenever a new insert happens, the ObjectID, GlobalID generates.

Can you please help me get an idea to understand how?

0 Kudos
PanagiotisPapadopoulos
Esri Regular Contributor

before sent the data with applyEdits they can execute a query using the rest end point with the notification number.

See here for more information

https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm

  • If a feature exist they can use the ObjectID from the Json response in order to prepare an applyEdit request for update attributes and/or shape.

0 Kudos