Reconcile but not working

370
1
Jump to solution
07-12-2017 12:16 PM
ShaningYu
Frequent Contributor

I created child version from an myEdit version.  Then, I edited a featureLayer of the child version in ArcMap.  Then I tried to reconcile the child version to its parent version: myEdit (by referring to the source code: How to reconcile versions ) using the code below.  However, after implementing this piece of code, the FeatureClass in the target version does not show any edits I made.  I am not sure I have missed anything.  Appreciate if you can share your experience.   

// the related code

bool Reconcile_ToParentVersion()   {
            bool conflicts = false;
            IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)m_userWorkspace;

            if (sParentVersionName == "") {
                if (m_editorVersion.HasParent())  {
                    IVersionInfo versionInfo = m_editorVersion.VersionInfo;
                    sParentVersionName = versionInfo.Parent.VersionName;
                }
            }

            IVersion targetVersion = versionedWorkspace.FindVersion(sParentVersionName) ;
            IVersionEdit4 versionEdit = (IVersionEdit4)m_editorVersion;         
            if (m_muWorkspaceEdit.SupportsMultiuserEditSessionMode(esriMultiuserEditSessionMode.esriMESMVersioned) && targetVersion != null)  {
                m_muWorkspaceEdit.StartMultiuserEditing(esriMultiuserEditSessionMode.esriMESMVersioned);
                //Reconcile with the target version.
                conflicts = versionEdit.Reconcile4(targetVersion.VersionName, true, false, false, false);
            }

            return conflicts;;

}

0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Frequent Contributor

The problem got solved by adding the code below:

                //Post to the target version.
                if (versionEdit.CanPost())
                    versionEdit.Post(targetVersion.VersionName);

Thanks for your review.

View solution in original post

0 Kudos
1 Reply
ShaningYu
Frequent Contributor

The problem got solved by adding the code below:

                //Post to the target version.
                if (versionEdit.CanPost())
                    versionEdit.Post(targetVersion.VersionName);

Thanks for your review.

0 Kudos