Demonstrates the workflow of getting the network state and validating the topology of a utility network.
Dirty areas are generated where edits to utility network features have not been evaluated against the network rules. Tracing across this area could result in an error or return inaccurate results. Validating the utility network updates the network topology with the edited feature data, maintaining consistency between the features and topology. Querying the network state allows you to determine if there are dirty areas or errors in a utility network, and if it supports network topology.
Select features to make edits and then use 'Update and Apply Edit' to send edits to the server.
- Tap 'Get state' to check if validate is required or if tracing is available.
- Tap 'Validate' to validate network topology and clear dirty areas.
- Tap 'Trace' to run a trace.
- Create and load a
Map
with a web map item URL. - Load the
UtilityNetwork
from the web map and switch itsServiceGeodatabase
to a new branch version. - Add
LabelDefinition
s for the fields that will be updated on a feature edit. - Add the
UtilityNetwork.DirtyAreaTable
to the map to visualize dirty areas or errors. - Set a default starting location and trace parameters to stop traversability on an open device.
- Get the
UtilityNetworkCapabilities
from theUtilityNetworkDefinition
and use these values to enable or disable the 'Get State', 'Validate', and 'Trace' buttons. - When an
ArcGISFeature
is selected for editing, populate the choice list for the field value using the field'sCodedValueDomain.CodedValues
. - When 'Update and Apply Edits' is clicked, update the value of the selected feature's attribute value with the selected
CodedValue.Code
and callServiceGeodatabase.ApplyEditsAsync()
. - When 'Get State' is clicked, call
UtilityNetwork.GetStateAsync()
and print the results. - When 'Validate' is clicked, get the current map extent and call
UtilityNetwork.ValidateNetworkTopology()
. - When 'Trace' is clicked, call
UtilityNetwork.TraceAsync()
with the predefined parameters and select all features returned. - When 'Clear Selection' or 'Cancel' are clicked, clear all selected features on each layer in the map and close the attribute picker.
- UtilityElement
- UtilityElementTraceResult
- UtilityNetwork
- UtilityNetworkCapabilities
- UtilityNetworkState
- UtilityNetworkValidationJob
- UtilityTraceConfiguration
- UtilityTraceParameters
- UtilityTraceResult
The Naperville electric feature service contains a utility network that can be used to query the network state and validate network topology before tracing. The Naperville electric webmap uses the same feature service endpoint and is shown in this sample. Authentication is required and handled within the sample code.
dirty areas, edit, network topology, online, state, trace, utility network, validate