utils

AMD: require(["esri/versionManagement/utils"], (versionManagementUtils) => { /* code goes here */ });
ESM: import * as versionManagementUtils from "@arcgis/core/versionManagement/utils.js";
Object: esri/versionManagement/utils
Since: ArcGIS Maps SDK for JavaScript 4.30

Provides utility methods for creating VersioningStates.

Method Overview

Name Return Type Summary Object

Used to generate an instance of VersioningState.

utils

Used to get an instance of VersioningState from a View

utils

Method Details

createVersioningStates

Method
createVersioningStates(input, usePersistentReadSessions){Promise<Collection<VersioningState>>}

Used to generate an instance of VersioningState.

Parameters

Input used to generate VersioningStates.

usePersistentReadSessions Boolean

If the set to true, the current version will have a read lock. Additionally, when switching versions, the new current version will also have a read lock.

Returns
Type Description
Promise<Collection<VersioningState>>
  • When resolved returns a Collection of VersioningState instances.
Example
const webmap = new WebMap({
  portalItem: { // autocasts as new PortalItem()
    id: "e691172598f04ea8881cd2a4adaa45ba"
  }
});
const versioningStates = await utils.createVersioningStates(webmap, false);

getVersioningStates

Method
getVersioningStates(view, usePersistentReadSessions){Promise<Collection<VersioningState>>}

Used to get an instance of VersioningState from a View

Parameters
view View

View used to get VersioningStates.

usePersistentReadSessions Boolean

If the set to true, the current version will have a read lock. Additionally, when switching versions, the new current version will also have a read lock.

Returns
Type Description
Promise<Collection<VersioningState>>
  • When resolved returns a Collection of VersioningState instances.
Example
const webmap = new WebMap({
    portalItem: { // autocasts as new PortalItem()
    id: "e691172598f04ea8881cd2a4adaa45ba"
  }
});
const view = new View({
    map: webmap,
    container: "viewDiv",
});
const versioningStates = await utils.getVersioningStates(view, false);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.