Reconcile and Post Conflict Detection Enhancement Please

Idea created by carrierkh on Nov 27, 2012
    New
    Score240
    I am really impressed with the amount of functionality added in models and python for database administration in 10.1. One area which I think could still be improved is with the ReconcileVersions_management tool. If I were going to use the example for batch reconcile and post found here. I still have no way of trapping if conflicts were found. I think many of us would want to know within the script if a conflict was found and kick off another function or process. For example;

    If conflicts == true:
        send email and attach log file(Conflicts Exist!!!)
        compress database
        resume connections to database
        run analyze
    else:
        send email that no conflicts found(Reconcile Post Successful)
        compress database
        recreate versions
        resume connections to database
        run analyze
        start ArcGIS Server/Services

    Currently there is no way out of the box to return a variable to know whether conflicts exist. We can tell the tool to abort if conflicts but once the tool has run how do we know or catch if conflicts existed? If there could be a variable returned to let us know, we could parse out the logic in our scripts to account for conflicts. For example, I would not recreate the versions if conflicts were detected because I would not delete those versions until the conflicts were resolved.

    The only logic I have been able to come up with currently is to iterate through the versions after the ReconcileVersions_management tool has run, if the count of the list is 1, then I can only assume that this is the default version. If more than 1 version exist I can assume there was a conflict but how do I really know unless the tool can return a boolean variable letting me know. Below is the logic;

    versionList = arcpy.ListVersions(InputDBConn)
         arcpy.ReconcileVersions_management(InputDBConn, "ALL_VERSIONS", "sde.DEFAULT", versionList, "LOCK_ACQUIRED", "ABORT_CONFLICTS", "BY_OBJECT", "FAVOR_TARGET_VERSION", "POST", "DELETE_VERSION")
         print "after reconcile"
         versionList = arcpy.ListVersions(InputDBConn)
         print versionList
         if versionList == 1:
             print "Reconcile and Post Successful"
         else:
             print "More than 1 version found conflicts might exist?"

         So is it possible to return some type of variable so we can flag if conflicts existed or not after the ReconcileVersions_management tool has run please?