5

The client has a Feature Class in SDE 9.3.1. When a feature in the feature class is edited the client wants to automatically record the date/time and who edited it in the feature class attributes.

I have found a few references to putting database triggers on the "A" table. Also for creating a class extension.

Is there an plusses or minuses for doing either one? Are there any other options that I am missing?

Thanks

4 Answers 4

2

you can develope a custom class extension to do this for you. Each feature class or table that has the class extension and the required fields, will be able to that for you.

Check this link on how: http://resources.esri.com/help/9.3/arcgisengine/dotnet/6caed32d-8baf-4771-8bb4-2f350b7f0d7a.htm

The good thing about class extensions is that any client that contains the code (or executable or dll) for it, will present the same behavior.

Ok, pros and cons of each:

  • Triggers

    Pros

    Works for all clients, no need to deploy

    Cons

    Can bury "some" (in this case a little less - because it's just a timestamp) of the bussiness rules inside database, harder to maintain

  • Class Extensions

    Pros

    Can be applied to new feature classes without compiling new triggers

    Can be applied to "n" feature classes or tables, without multiplicty of code. All you need is to configure and make sure they have the same fields.

    Works for all ArcObjects clients

    Domain rules stay within the domain (this is more important when we are talking about more complex feature classes, but anyways)

    Cons

    Needs to be deployed to every client to work

2

I can't speak to the triggers but..

One alternative is the Attribute Assistant (a component of the Infrastructure Editing Template) that ESRI's water group created. There is an xml configuration file to set up the attribute assistant rules. We use it to track created date/user and edited date/user. One weakness is that this is run from ArcMap and allows users to turn the feature on and off.

1

I am currently using http://arcscripts.esri.com/details.asp?dbid=15694 which, I think, implements the class extension referenced in one of the answers above. Takes two minutes to deploy (though you may have to involve IT if user is NOT admin on box). It's works like a charm..

Alternative which may fit into an overall solution may be Archiving if you are versioning..but I can't seem to get it to work..look for a post on it here soon.

My issue now is that it only detects general changes. I need to know whether the change is spatial or attribute wise. I put together a script to use the EDIT_DATE that is generated to get changes in a range of time then use the FeatureCompare from the ArcToolbox, which shoots out a txt file which we then read to see the differences. Though we rely on a guid to do this. But a spatial change to a record could of occured because to records were merged, where both records represented a single entity so overall to end users the entity didn't change but in the gdb one record was deleted and another record was changed which is seemingly going to make us a put in a huge list of business logic to see if there was an overall change. Ramble, ramble, ramble.

1

I think you are overthinking this one. Create a model in modelbuilder like the one below.

Source Data -> Make Feature Layer -> SourceData Layer -> Calculate field -> Source Data Layer

Set the expression for the Make Feature Layer to something like "DATEPROJECTCOMPLETED IS NULL AND PROJECTCOMPLETED1 = 1". So it only updates records where the date is null and the project has been completed.

Set the Calculate field expression to "time.strftime('%d/%m/%Y')" using python. This will add the current date to the records identified above.

Finally, export the script out of modelbuilder to python. Create a batch file which runs the script. Use the task scheduler to run the task once a day at around 11PM so it records the proper date.

Make sure the time and date settings are correct on the machine this is running on. May want to change the path environment variable to run Python more easily.

1
  • Ari, I don't think this meets the criteria when a feature in the feature class is edited since it won't capture the exact time of the edit, and who edited it since this information won't be captured. It also relies on the admin to run a process, so will fail if the process isn't run. Sep 7, 2011 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.