▾
import TraverseAssociationsParameters from "@arcgis/core/rest/networks/support/TraverseAssociationsParameters.js";const TraverseAssociationsParameters = await $arcgis.import("@arcgis/core/rest/networks/support/TraverseAssociationsParameters.js");- Inheritance
- TraverseAssociationsParameters→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 5.2
TraverseAssociationsParameters describes the optional parameters to execute the traverseAssociations function, which returns a list of associations and objects filtered by the parameters set.
- Example
- // Define the TraverseAssociationsParametersconst traverseAssociationsParameters = new TraverseAssociationsParameters({direction: "ascending",stopAtFirstSpatial: false,elements: [{networkSourceId: 10,globalId: "{456C46BC-C7A2-4963-8670-FE2B6B299758}",},],});// Traverse associationsconst response = await traverseAssociations(networkServiceUrl, traverseAssociationsParameters);// Print out the first association and first objectconsole.log(response.associations[0]);console.log(response.objects[0]);
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| readonly inherited | ||
| | ||
| | ||
| NetworkElement[] | null | undefined | | |
| | ||
| | ||
| | ||
| | ||
| | ||
| TraverseType[] | null | undefined | |
dirtyStatusFilter
- Type
- DirtyStatusFilterType | null | undefined
Specifies whether to filter based on the dirty status of the association. Possible values: none | dirty | notDirty
elements
- Type
- NetworkElement[] | null | undefined
The NetworkElements for which the association traversal is initiated.
errorStatusFilter
- Type
- ErrorStatusFilterType | null | undefined
Specifies whether to filter associations based on the error code. Possible values: none | inError | notInError
moment
The date/timestamp (in UTC) to execute the function. This could be used to run the function in a moment in the past or in long transaction mode (undo/redo). Applicable to branch versioned datasets only.
- See also
type
- Type
- TraverseType[] | null | undefined
The type of traversal to perform.
To create a custom traversal the direction, dirtyStatusFilter, errorStatusFilter, stopAtFirstSpatial, and maxDepth parameters can be used.
When a traversal type is specified using the type parameter other than the default "unspecified", these parameters are ignored.
Possible Values
| Value | Description |
|---|---|
| unspecified | A custom traversal will be performed according to these parameters: direction, dirtyStatusFilter, errorStatusFilter, stopAtFirstSpatial, and maxDepth. |
| dirty-area-expansion | Returns associations and objects that have been modified and are marked as dirty. Completes a downward traversal, then an ascending traversal, with an exit filter on the first spatial feature in each direction. |
| first-containers | Completes an ascending traversal on containment associations, with an exit filter on the first spatial feature. |
| spatial-parents | Completes an ascending traversal on all association types, with an exit filter on the first spatial feature. |
| top-containers | Completes an ascending traversal to return associations and objects with no exit filter. |
| errors-not-modified | Completes a downward traversal to return associations in error, with an exit filter on the first spatial feature. |
| modified-objects | Completes a downward traversal to return associations that are dirty, with an exit filter on the first spatial feature. |
Methods
| Method | Signature | Class |
|---|---|---|
| inherited static | fromJSON(json: any): any | |
| inherited | toJSON(): any |
fromJSON
- Signature
-
fromJSON (json: any): any
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
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | 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.
toJSON
- Signature
-
toJSON (): any
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.