Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

When I reconcile a version in Arc Map, if it has any conflicts it will stop the reconcile operation and open a window. The window shows the conflicts of that particular version with red dots. My task is to read those values and generate a report which contains only conflict fields.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Directly its not possible.

See the code below

IVersionEdit4 = pVersionEdit4;
pVersionEdit4.Reconcile4("SDE.DEFAULT", true, false, false, false)

From that

IFeatureWorkspace commonAncestorFWorkspace = (IFeatureWorkspace)pVersionEdit4.CommonAncestorVersion;
                IFeatureWorkspace preReconcileFWorkspace = (IFeatureWorkspace)pVersionEdit4.PreReconcileVersion;
                IFeatureWorkspace reconcileFWorkspace = (IFeatureWorkspace)pVersionEdit4.ReconcileVersion;
                IEnumConflictClass pEnumConflictClass = pVersionEdit4.ConflictClasses;
                IConflictClass pConflictClass = null;
                //Loop through all conflict classes
                while ((pConflictClass = pEnumConflictClass.Next()) != null)
                {
                    IDataset pDataSet = pConflictClass as IDataset;
                    string datasetname = pDataSet.Name;
                    ISelectionSet pSelectionSet = pConflictClass.UpdateUpdates;
                    IFeatureClass featureClassPreReconcile = preReconcileFWorkspace.OpenFeatureClass(datasetname);
                    IFeatureClass featureClassReconcile = reconcileFWorkspace.OpenFeatureClass(datasetname);
                    IFeatureClass featureClassCommonAncestor = commonAncestorFWorkspace.OpenFeatureClass(datasetname);
                    IEnumIDs pEnumIds = pSelectionSet.IDs;
                    int oid =  - 1;
                    //Loop through all conflicting features. 
                    while ((oid = pEnumIds.Next()) != -1)
                    {
                        // Get conflict feature on the three reconcile versions.
                        IFeature featurePreReconcile = featureClassPreReconcile.GetFeature(oid);
                        IFeature featureReconcile = featureClassReconcile.GetFeature(oid);
                        IFeature featureCommonAncestor = featureClassCommonAncestor.GetFeature(oid);
                        //Loop through all fields of a conflict feature.
                        for (int intField = 0; intField < featurePreReconcile.Fields.FieldCount; intField++)
                        {
                            //Finding the conflict by checking two versions.
                            if (featurePreReconcile.get_Value(intField).ToString()!=featureReconcile.get_Value(intField).ToString())
                            {
                                //Writing to the Log.
                                base.LogReport(new string[] { WorkOrderName, featureClassPreReconcile.AliasName, oid.ToString(), featureReconcile.Fields.get_Field(intField).Name, featureReconcile.get_Value(intField).ToString(), featurePreReconcile.get_Value(intField).ToString(), featureReconcile.get_Value(intField).ToString(), featureCommonAncestor.get_Value(intField).ToString() });
                            }
                        }
                    }
                }

We will get the UID's of conflict classes. From that we should compare PreReconcileVersion and ReconcileVersion then we will get conflict field value.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.