Applications made in UNE for ArcGIS are capable of working with branch versioned data.

What is a version?

A version is a simulated copy of the geodatabase that compartmentalizes edits. Versions allow you and all other users connected to the same version to see your changes. Users connected to other versions do not see your changes until you reconcile and post them to an ancestor version.

For an overview of versioning see here.

Versioning support requires ArcGIS Enterprise.

Versioning capabilities

There are many ways that versioning can be configured, used and changed in UNE. The following facilities exist:

  • A versioning panel

    This panel can optionally be included in your app. It allows versions to be created, switched to, deleted and edits posted to the default version. All behaviours of this panel are configurable. For example Delete version can be removed.

    Versioning Client Panel
  • URL launch parameters

    Any UNE application can be opened against a particular version, using URL launch parameters. The gdbversion parameter can just be added to the URL.

  • Arcade commands

    It is possible to switch to a version, and create a new version using Arcade Commands.

When versioning is being used, all operations, and the undo/redo actions must wait for the server to process the individual commands. In particular, when making first edits, the application must begin an exclusive edit session.

When working with versioning, only one user can edit a version at a time (ie. an exclusive lock). This lock must be released by Saving or Discarding the changes. When using versioning, these commands will appear on the toolbar.

By default the application will not allow editing directly against the default version. If this is required behaviour, the application can be configured to automatically create a version and post the changes back to the default version, when the edits are saved.

Configuring versioning

In order to use branch versioning, it must be configured. Please run through the following steps

  1. Create and publish data with Branch Versioning Enabled to ArcGIS Enterprise.
  2. Create a web map and a UNE application that uses the data in the versioned service.
  3. In the UNE Builder, choose the Data button in the Wireframe Editor. If the web map contains versioned data, there will be a Branch versioning section. In here, choose one of the layers in the web map, that has branch versioning enabled.
  4. Ensure that in the Data processing section, the app is configured to Wait for server triggered changes. This setting means that the app will correctly digest changes that occur in server side attribute rules.
  5. If you wish to allow automatic version creation when trying to edit the default version, enable this setting:
    Temporary version

Adding the versioning panel

In order to allow end users to interact with versioning directly in the app, please add the versioning panel.

  1. In the UNE Builder, choose the + button to add a new panel.
  2. Select the Versioning panel.
  3. Versioning control will now be available in the application. Please configure the required behaviour of this panel in the panel settings.
    Versioning panel settings

Opening an app against a particular version

There are two ways an application can be opened against a particular version automatically.

URL parameters

The application can be launched with a specific gdb version appended to the URL. UNE will detect this variable and automatically switch to this version of the data.

https://..../index.html?app=.........&gdbVersion=versionname

Please see the Launching URL tasks guide for more details.

Start-up actions

Start-up actions can be configured to perform a wide variety of tasks when a UNE application first starts up. Start-up actions are built using the task framework, which is shared by many of the capabilities within UNE. Please see the task guides for further information.

For details on how to configure and setup start-up actions, please refer to this guide.

To create a task that changes the gdb version of the data at start-up, it is necessary to use the run application action task. This task is a general task that instructs the application to perform a particular activity.

The following is an example task, that switches the application to use a specific version.

return {
  command: "set-gdbversion",
  silent: false,// Will not show warning messages before switching
  version: "<SDE VERSION>"
};

Using versioning in scripts and tasks

In order to support working with versioning, the scripting framework within UNE provides a number of functions. These are:

  • gdbVersionList: Lists all the gdb versions available.
  • gdbVersion ( layer ): Finds the current gdb version for a layer.
  • gdbVersionCreate ( url_or_layer, name, description, accessPermission): Creates a new version with required name, description and access.

Also, as seen for the start-up action, the UNE task framework supports changing versions, using the application command set-gdbversion.

UNE’s task framework has special commands to change the current geodatabase version.

Changing versions will reset selections and the undo/redo state.