What is the best way to execute custom code when a version is posted to DEFAULT?

807
4
10-25-2010 10:45 AM
JordanParmer
New Contributor
I need to write custom code that compares versions on 'Post'.  I want to compare the edit version being posted to the DEFAULT version prior to the actual edits being committed in DEFAULT.

I've thought of writing a custom Post command for ArcMap, but this requires all of our GIS analysts to have the extension installed (and use it).  That is too much of a training risk. 

It would be ideal if I could catch the Post at the database level so that no matter who posts, I can handle the event. 

Any ideas on how I might do that (or something similar)?
0 Kudos
4 Replies
JamesMacKay
New Contributor
Hi Jordan,

One option would be to create a workspace extension that implements the IVersionEvents2 interface. The major drawback of this is that you'd still have to deploy a DLL to all of your users, but it has the advantage over a custom command that your users can still rely on the standard post command. Once they install the DLL the user experience won't change for them at all.

Here's a link with more information: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_workspace_exte...

Cheers,
James
0 Kudos
JordanParmer
New Contributor
Hey James,

That is a good idea.  I've been looking into it.  Unfortunately, the way our company is structured, our GIS analysts are somewhat sandboxed from our development group.  There is a likely chance that a new employee will get a machine pre-loaded with a GIS image without our extensions installed. 

After thinking on this, I think I'm going to have the GIS analysts post all of their edits to a QA/QC version and then write a custom process that posts that version to DEFAULT allowing me to run custom code comparing the two versions.

Is there a way to prevent people from posting to DEFAULT?
0 Kudos
JamesMacKay
New Contributor
I think setting your DEFAULT version's permissions to Protected should give you what you're looking for.

Cheers,
James
0 Kudos
JordanParmer
New Contributor
Thanks James!  I'll look into that.
0 Kudos