import UnitIdentifierManager from "@arcgis/core/networks/UnitIdentifierManager.js";
Inheritance
UnitIdentifierManagerAccessor
Since
ArcGIS Maps SDK for JavaScript 4.34

A UnitIdentifierManager provides access to unit identifier management capabilities for a telecom domain network in a utility network.

See also
Example
const utilityNetwork = new UtilityNetwork({
layerUrl: "https://host.com/arcgis/rest/services/Test/FeatureServer/0",
});
await utilityNetwork.load();
const unitIdentifierManager = await utilityNetwork.getUnitIdentifierManager();

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
readonly inherited
readonly
readonly
readonly

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

featureServiceUrl

readonly Property
Type
string

Returns the root feature service URL which the utility network is part of.

Example
`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/`

gdbVersion

readonly Property
Type
string | null | undefined

The version of the geodatabase of the feature service data used by the utility network. Read the Overview of versioning topic for more details about this capability.

historicMoment

readonly Property
Type
Date | null | undefined

The utility network's historic moment to query. If this property is not specified, queries will apply to the current features.

networkServiceUrl

readonly Property
Type
string

The URL of the network server.

Example
`https://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/UtilityNetworkServer/`

utilityNetwork

readonly Property
Type
UtilityNetwork

The UtilityNetwork that contains the telecom domain network being managed.

Methods

MethodSignatureClass
inherited static
fromJSON(json: any): any
generateCombineNetworkElements(networkElements: NetworkElement[]): ServiceEdits
generateDivideNetworkElements(networkElement: NetworkElement, numUnits: number[]): ServiceEdits
query(containers: UnitIdentifier[]): Promise<UnitQueryResult[]>
reserve(container: UnitIdentifier, firstUnit: number, lastUnit: number): Promise<void>
reset(containers: UnitIdentifier[]): Promise<void>
resize(content: UnitIdentifier, lastUnit: number): Promise<void>
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters

ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

generateCombineNetworkElements

Method
Signature
generateCombineNetworkElements (networkElements: NetworkElement[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 5.1

Returns ServiceEdits to combine network elements in a telecom domain network via the applyEdits method on the FeatureService class.

The objects being combined must have consecutive unit IDs, exist in the same table and unit container, and have the same attribute values.

Parameters

ParameterTypeDescriptionRequired
networkElements

The network elements to combine in a telecom domain network.

Returns
ServiceEdits

ServiceEdits for combining network elements in a telecom domain network.

Example
const networkElementA = new NetworkElement({
globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",
networkSourceId: 20,
});
const networkElementB = new NetworkElement({
globalId: "{74100804-E229-49b8-8CDC-9B5D3EF03EDA}",
networkSourceId: 20,
});
const networkElementC = new NetworkElement({
globalId: "{39B856DC-AFE4-4c02-B433-A9361ACD91CF}",
networkSourceId: 20,
});
const serviceEdits = unitIdentifierManager.generateCombineNetworkElements([
networkElementA,
networkElementB,
networkElementC,
]);
await featureService.applyEdits([serviceEdits]);

generateDivideNetworkElements

Method
Signature
generateDivideNetworkElements (networkElement: NetworkElement, numUnits: number[]): ServiceEdits
Since
ArcGIS Maps SDK for JavaScript 5.1

Returns ServiceEdits to divide a grouped network element in a telecom domain network into two or more grouped elements via the applyEdits method on the FeatureService class.

Parameters

ParameterTypeDescriptionRequired
networkElement

The grouped network element in a telecom domain network to divide into two or more grouped elements.

numUnits
number[]

Describes how the unit identifiers of the grouped object should be divided. Each number in this array describes the number of units to assign an object resulting from the division. E.g., to divide one object with 6 units into an object with 5 units and another object with 1 unit, specify [5, 1].

Returns
ServiceEdits

ServiceEdits for dividing a network element in a telecom domain network.

Example
const networkElement = new NetworkElement({
globalId: "{6CE34136-EC3A-40D7-80BF-E1D9BE33812A}",
networkSourceId: 20,
});
const serviceEdits = unitIdentifierManager.generateDivideNetworkElements(networkElement, [2, 3, 4]);
await featureService.applyEdits([serviceEdits]);

query

Method
Signature
query (containers: UnitIdentifier[]): Promise<UnitQueryResult[]>

Returns unit identifiers for, and existing gaps in, a unit container feature's containment hierarchy in a telecom domain network.

Parameters

ParameterTypeDescriptionRequired
containers

The unit container features or objects to query.

Returns
Promise<UnitQueryResult[]>

Resolves to an array of objects describing the unit identifiers and gaps for the specified unit containers.

Example
const containers: UnitIdentifier[] = [
{
sourceId: 16,
globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",
},
];
const results = await unitIdentifierManager.query(containers);

reserve

Method
Signature
reserve (container: UnitIdentifier, firstUnit: number, lastUnit: number): Promise<void>

Shifts existing records in the containment hierarchy of a unit container's NextUnitID sequence to reserve a range of unit IDs in a telecom domain network.

When this range is inserted at the end of the sequence, the NEXTUNITID attribute value for the unit container increases. If a range is inserted into the middle of an existing sequence to create a gap, the system will attempt to shift existing records to accommodate the reserved space. The operation will fail and return an error if the reservation requires regrouping an object or occurs in the middle of a connectivity assignment.

Parameters

ParameterTypeDescriptionRequired
container

The unit container to insert a gap into.

firstUnit

The first unit for the gap to be introduced.

lastUnit

The last unit for the gap to be introduced.

Returns
Promise<void>

Resolves when the gap is successfully inserted.

Example
const container: UnitIdentifier = {
sourceId: 16,
globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",
};
await unitIdentifierManager.reserve(container, 2, 5);

reset

Method
Signature
reset (containers: UnitIdentifier[]): Promise<void>

Resets the unit identifiers associated with one or more unit container features in a telecom domain network. This is done to condense the unit identifier space or overcome unit identifier sequence exhaustion.

Parameters

ParameterTypeDescriptionRequired
containers

The unit container features or objects to be reset.

Returns
Promise<void>

Resolves when the containers are successfully reset.

Example
const containers: UnitIdentifier[] = [
{
sourceId: 16,
globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",
},
];
await unitIdentifierManager.reset(containers);

resize

Method
Signature
resize (content: UnitIdentifier, lastUnit: number): Promise<void>

Alters the number of units associated with a unit identifier feature in a telecom domain network.

Parameters

ParameterTypeDescriptionRequired
content

The unit identifiable feature or object being resized.

lastUnit

The last unit for the feature or object to be resized to.

Returns
Promise<void>

Resolves when the feature or object is successfully resized.

Example
const content: UnitIdentifier = {
sourceId: 16,
globalId: "{25B5F11B-70A2-4A61-9284-F0CE4C1E2111}",
};
await unitIdentifierManager.resize(content, 8);

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.