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;;
}
Solved! Go to Solution.
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.
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.