import TraverseAssociationsParameters from "@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.

See also
Example
// Define the TraverseAssociationsParameters
const traverseAssociationsParameters = new TraverseAssociationsParameters({
direction: "ascending",
stopAtFirstSpatial: false,
elements: [
{
networkSourceId: 10,
globalId: "{456C46BC-C7A2-4963-8670-FE2B6B299758}",
},
],
});
// Traverse associations
const response = await traverseAssociations(networkServiceUrl, traverseAssociationsParameters);
// Print out the first association and first object
console.log(response.associations[0]);
console.log(response.objects[0]);

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.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor
Since
ArcGIS Maps SDK for JavaScript 4.7

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

direction

Property
Type
[ "ascending" | "descending" ] | null | undefined

Specifies the direction of the association traversal.

dirtyStatusFilter

Property
Type
DirtyStatusFilterType | null | undefined

Specifies whether to filter based on the dirty status of the association. Possible values: none | dirty | notDirty

elements

Property
Type
NetworkElement[] | null | undefined

The NetworkElements for which the association traversal is initiated.

errorStatusFilter

Property
Type
ErrorStatusFilterType | null | undefined

Specifies whether to filter associations based on the error code. Possible values: none | inError | notInError

gdbVersion

Property
Type
string | null | undefined

The geodatabase version to execute the function against. Defaults to SDE.DEFAULT, if no version is provided.

maxDepth

Property
Type
number | null | undefined

Specifies how many hops through the association graph are allowed in either the ascending or descending direction. Defaults to MAX_INT.

moment

autocast Property
Type
Date | null | undefined

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

stopAtFirstSpatial

Property
Type
boolean | null | undefined

If true, the traversal of associations from nonspatial object to feature will stop when a spatial feature is encountered. The traversal will stop at the feature and will not traverse to the next nonspatial object.

type

Property
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

ValueDescription
unspecifiedA custom traversal will be performed according to these parameters: direction, dirtyStatusFilter, errorStatusFilter, stopAtFirstSpatial, and maxDepth.
dirty-area-expansionReturns 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-containersCompletes an ascending traversal on containment associations, with an exit filter on the first spatial feature.
spatial-parentsCompletes an ascending traversal on all association types, with an exit filter on the first spatial feature.
top-containersCompletes an ascending traversal to return associations and objects with no exit filter.
errors-not-modifiedCompletes a downward traversal to return associations in error, with an exit filter on the first spatial feature.
modified-objectsCompletes a downward traversal to return associations that are dirty, with an exit filter on the first spatial feature.

Methods

MethodSignatureClass
inherited static
fromJSON(json: any): any
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.

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.