ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data Namespace / PostOptions Class / PartialPostSelections Property
Example

In This Topic
    PartialPostSelections Property
    In This Topic
    Gets or sets a list of Selection objects based on SelectionType.ObjectID to be posted to the default version.
    Syntax
    public List<Selection> PartialPostSelections {get; set;}
    Public Property PartialPostSelections As List(Of Selection)
    Remarks
    If the underlying data store supports branch versioning and partial posting, Version.Post will post the data specified by the list of Selection objects to the default version. Partial posting requires ArcGIS Enterprise 10.9 or higher and is not supported with utility networks, topologies, or parcel fabrics. This property is not valid for traditional versioning.
    Example
    Partial Posting
    // Partial posting allows developers to post a subset of changes made in a version.
    // One sample use case is an electric utility that uses a version to design the facilities in
    // a new housing subdivision. At some point in the process, one block of new houses have been
    // completed, while the rest of the subdivision remains unbuilt.  Partial posting allows the user
    // to post the completed work, while leaving not yet constructed features in the version to be
    // posted later. Partial posting requires a branch-versioned feature service using ArcGIS
    // Enterprise 10.9 and higher
    
    // Specify a set of features that were constructed
    QueryFilter constructedFilter = new QueryFilter()
    {
      WhereClause = "ConstructedStatus = 'True'"
    };
    // This selection represents the inserts and updates to the support
    // structure feature class that we wish to post
    using (Selection constructedSupportStructures = supportStructureFeatureClass.Select(constructedFilter, SelectionType.ObjectID, SelectionOption.Normal))
    {
      // Specifying which feature deletions you wish to post is slightly trickier, since you cannot issue
      // a query to fetch a set of deleted features Instead, a list of ObjectIDs must be used
      using (Selection deletedSupportStructures = supportStructureFeatureClass.Select(
                                          null, SelectionType.ObjectID, SelectionOption.Empty))
      {
        deletedSupportStructures.Add(deletedSupportStructureObjectIDs);  //deletedSupportStructureObjectIDs is
                                                                         //defined as List<long>
    
        //Perform the reconcile with partial post
        //At 2.x - 
        //ReconcileDescription reconcileDescription = new ReconcileDescription();
        //reconcileDescription.ConflictDetectionType = ConflictDetectionType.ByColumn;
        //reconcileDescription.ConflictResolutionMethod = ConflictResolutionMethod.Continue;
        //reconcileDescription.ConflictResolutionType = ConflictResolutionType.FavorEditVersion;
        //reconcileDescription.PartialPostSelections = new List<Selection>() { constructedSupportStructures, deletedSupportStructures };
        //reconcileDescription.WithPost = true;
    
        //ReconcileResult reconcileResult = designVersion.Reconcile(reconcileDescription);
    
        ReconcileOptions reconcileOptions = new ReconcileOptions();//reconcile against Default
        reconcileOptions.ConflictDetectionType = ConflictDetectionType.ByColumn;
        reconcileOptions.ConflictResolutionMethod = ConflictResolutionMethod.Continue;
        reconcileOptions.ConflictResolutionType = ConflictResolutionType.FavorEditVersion;
    
        PostOptions postOptions = new PostOptions();//post against Default
        postOptions.PartialPostSelections = new List<Selection>() {
                        constructedSupportStructures, deletedSupportStructures };
        postOptions.ServiceSynchronizationType = ServiceSynchronizationType.Synchronous;
    
        ReconcileResult reconcileResult = designVersion.Reconcile(reconcileOptions, postOptions);
    
        //TODO process result(s)
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also