Post/Reconcile with Model Builder

3431
4
05-16-2011 12:02 PM
JoseSanchez
Occasional Contributor III
Hi all

I need to copy records that are compelted from one feature to another feature in a weekly basis.

Because both features are versioned, let me know if this sequence is correct:
- first create a version
- reconcile
- append records records from one FC to the other
- post


I got the following error message:

Error 000533: the version can not be posted to the weconcile version. Reconcile must be performed before the post operation has been done. 

Failed to execute post.

please advise!
0 Kudos
4 Replies
JoseSanchez
Occasional Contributor III
I createdwith model builder and exported to python a script that runs the following commands
  - creates version
  - seelct features to be appended
  - appends features
  - post checking the option "Reconcile"

and it looks like it works


 
# Process: Create Version...
gp.CreateVersion_management(XXXX_SDE_93_sde__2_, "SURADMIN.Pre_Prod", "Historical", "PUBLIC")

# Process: Make Feature Layer...
gp.MakeFeatureLayer_management(W_Source, Source_Layer, "STATUS = 'GIS Completed'", XXXX_SDE_93_sde, ".....")

# Process: Append...
gp.Append_management("Source_Layer", W_Historical__2_, "TEST", "", "")

# Process: Reconcile Version...
gp.ReconcileVersion_management(XXXX_SDE_93_sde, "LocalVersion.Historical", "SURADMIN.Pre_Prod", "BY_OBJECT", "FAVOR_TARGET_VERSION", "LOCK_AQUIRED", "NO_ABORT", "POST")

0 Kudos
RussellBrennan
Esri Contributor
Jose,

This will depend on how your versions were created and their child-parent relationships. The act of reconciling will pull edits from the parent version into the version that you edited (target) version. The act of posting will push the edits that you reconciled in your edit version to the parent version.

Like I said, there can be many scenarios that will work for you but it will depend on how the two versions you are interested in are related to each other.
-If the version that has the completed edits is a parent of the version you want to copy edits to all you need to do is reconcile the completed edit version with the other version.
-If both versions have a common parent, for example sde.DEFAULT, you could reconcile and post the completed edits version with the default version and then reconcile the version you want to copy edits to with the default version.

Keep in mind that the reconcile and post operations act on all edits in all versioned data in your geodatabase. If you are looking to just copy edits from one featureclass to another you might want to look at some of our programmatic methods for accessing version changes. Here is a link, look under the section "Data Changes object model" for some idea of how this works.
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Overview/0026000000r1000...
0 Kudos
JoseSanchez
Occasional Contributor III
Russell,

This is the structure of our SDE tree:
�?� First SDE.Default
�?� Second a child version from default called Pre-Production
�?� Third an user version child of Pre-Production

My goal is to run a script that will perform the following operations:
- move all the records that are completed in a feature class to an historical one,
- and then remove features  from the  regular feature class that were archived. 

I was able to write a Model Builder that  creates a new child version from Pre-Production, selects records to be archived,  appends them to the historical feature class,  deletes these same records from the regular feature class and then running a reconcile with the option option �??Post Version after Reconcile�?� checked it works propagates all the updates for the child to the parent.



But  if I uncheck this option  �??Post Version after Reconcile�?�  in the Reconcile box and I run a POST TO Pre-Produciton I get an error message.

What does not work is adding a post box after the reconcile in ModelBuilder, it always fails, why?

This is the error I got :

Error 000533: the version can not be posted to the reconcile version. Reconcile must be performed before the post operation has been done.

Please advice!
0 Kudos
RussellBrennan
Esri Contributor

This is the structure of our SDE tree:
�?� First SDE.Default
�?� Second a child version from default called Pre-Production
�?� Third an user version child of Pre-Production

My advice:
First, I would suggest that you do not choose a new name for the third version. Having two versions named Pre-Production seems like a recipe for problems down the road.


My goal is to run a script that will perform the following operations:
- move all the records that are completed in a feature class to an historical one,
- and then remove features  from the  regular feature class that were archived. 

The easiest way to do this would be to use archiving. If you enable archiving on your feature class you could reconcile and post your changes to the Default version. When the records are posted to the default version the archiving architecture will store those edits. You could then delete the edits in your edit version. You can then use the Archiving tools available to you in ArcGIS to view the data at specific points in time. It sounds like your workflow is exactly what Archiving was designed to address. In this case you do not need a second feature class to store the historical data.


I was able to write a Model Builder that  creates a new child version from Pre-Production, selects records to be archived,  appends them to the historical feature class,  deletes these same records from the regular feature class and then running a reconcile with the option option �??Post Version after Reconcile�?� checked it works propagates all the updates for the child to the parent.

But  if I uncheck this option  �??Post Version after Reconcile�?�  in the Reconcile box and I run a POST TO Pre-Produciton I get an error message.


If you wish to post your changes I do not understand why you want to use a tool other than the reconcile tool to perform this operation. See my comments below...


What does not work is adding a post box after the reconcile in ModelBuilder, it always fails, why?

This is the error I got :
Error 000533: the version can not be posted to the reconcile version. Reconcile must be performed before the post operation has been done.

There are some known bugs with this tool where the reconcile will fail with the error message you are describing. This is the most likely reason you are running not able to get it to complete. I am not entirely sure I understand the exact steps you are going through so I will offer the recommended workflow. It is recommended that if posting changes, the reconcile tool is used to perform the post operation. The post tool is still available for older models or scripts but if you are implementing a new model please use the reconcile tool be used for both functions.
0 Kudos