Skip to content
import TraceJobInfo from "@arcgis/core/networks/support/TraceJobInfo.js";
Inheritance:
TraceJobInfoTraceResultAccessor
Since
ArcGIS Maps SDK for JavaScript 4.27

Represents information pertaining to the execution of an asynchronous request on the server.

See also

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.

aggregatedGeometry

readonlyinherited Property
Type
AggregatedGeometry | null | undefined
Inherited from: TraceResult

This property defines an aggregation of geometries returned by the trace. The aggregated geometries will only include geometries that belong to features with assetgroups/assettypes specified in the trace output. This is returned only if the aggregated geometries results type is defined in the trace configuration.

circuits

readonlyinherited Property
Type
CircuitTraceResult[] | null | undefined
Inherited from: TraceResult
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

An array of circuits returned by the trace. Used in the telecom domain network. This is returned only if the "circuits" result type is defined in the trace configuration.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

elements

readonlyinherited Property
Type
NetworkElement[]
Inherited from: TraceResult

An array of network elements returned by the trace. The network element is a representation of how the network topology defines its graph. This is returned only if the elements results type is defined in the trace configuration.

The elements property returning a TelecomNetworkElement is in beta and is reserved for future use in a telecom domain network.

See also

globalFunctionResults

readonlyinherited Property
Type
FunctionResult[]
Inherited from: TraceResult

Returns an array of function aggregation results.

kFeaturesForKNNFound

readonlyinherited Property
Type
boolean
Inherited from: TraceResult

This parameter is specific to the K-Nearest Neighbors Algorithm, when the nearest filter is provided in the trace configuration. It returns true if any neighbors were found.

Default value
false

lastUpdatedTime

autocast Property
Type
Date | null | undefined

The last date and time the service was updated.

paths

readonlyinherited Property
Type
CircuitPath[] | null | undefined
Inherited from: TraceResult
Since
ArcGIS Maps SDK for JavaScript 4.34
beta

The paths returned by a path trace.

startingPointsIgnored

readonlyinherited Property
Type
boolean
Inherited from: TraceResult

Returns true if the starting points in the network trace operation are ignored.

Default value
false

status

Property
Type
TraceJobStatus

The job status.

statusUrl

Property
Type
string

ArcGIS Server Rest API endpoint to the resource that receives the validate network topology request.

submissionTime

autocast Property
Type
Date | null | undefined

The date and time in which Network.submitTopologyValidationJob() is first called.

warnings

readonlyinherited Property
Type
string[] | null | undefined
Inherited from: TraceResult

Returns any warnings encountered by the trace operation.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
checkJobStatus(requestOptions?: RequestOptions | null): Promise<TraceJobInfo>
destroy(): void
toJSON
inherited
toJSON(): any
waitForJobCompletion(options?: WaitForValidateOptions): Promise<TraceJobInfo>

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.

checkJobStatus

Method
Signature
checkJobStatus (requestOptions?: RequestOptions | null): Promise<TraceJobInfo>

Sends a request for the current state of this job.

Parameters
ParameterTypeDescriptionRequired
requestOptions

Additional options to be used for the data request (will override requestOptions defined during construction).

Returns
Promise<TraceJobInfo>

When resolved, returns a TraceJobInfo.

Example
const traceLocation = TraceLocation.fromJSON({
traceLocationType: "startingPoint",
globalId: "{BBF88249-6BAD-438F-9DBB-0E48DD89EECA}",
percentAlong: 0.5805425412252266
});
const traceParameters = TraceParameters.fromJSON({
traceConfigurationGlobalId: "{DF22DA8D-6EC0-408B-A8B2-E468EC7DC9BF}",
resultTypes: [
{
type: "elements",
includeGeometry: false,
includePropagatedValues: false,
networkAttributeNames: [],
diagramTemplateName: "",
resultTypeFields: []
},
{
type: "aggregatedGeometry",
includeGeometry: false,
includePropagatedValues: false,
networkAttributeNames: [],
diagramTemplateName: "",
resultTypeFields: []
}
],
traceType: "subnetwork"
});
traceParameters.traceLocations = [traceLocation];
const jobInfo = await network.submitTraceJob(traceParameters);
await jobInfo.checkJobStatus();

destroy

Method
Signature
destroy (): void

Stop monitoring this job for status updates.

// Stop monitoring this job for status updates.
jobInfo.destroy();
See also
Returns
void

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.

waitForJobCompletion

Method
Signature
waitForJobCompletion (options?: WaitForValidateOptions): Promise<TraceJobInfo>

Resolves when an asynchronous job has completed. Optionally job progress can be monitored.

Parameters
ParameterTypeDescriptionRequired
options

Options. See properties below for object specifications.

Returns
Promise<TraceJobInfo>

When resolved, returns a TraceJobInfo.

Example
// Submit an asynchronous trace job.
const traceLocation: TraceLocation = TraceLocation.fromJSON({
traceLocationType: "startingPoint",
globalId: "{BBF88249-6BAD-438F-9DBB-0E48DD89EECA}",
percentAlong: 0.5805425412252266
});
const traceParameters: TraceParameters = TraceParameters.fromJSON({
traceConfigurationGlobalId: "{DF22DA8D-6EC0-408B-A8B2-E468EC7DC9BF}",
moment: 1554214441244,
gdbVersion: "SDE.DEFAULT",
resultTypes: [
{
type: "elements",
includeGeometry: false,
includePropagatedValues: false,
networkAttributeNames: [],
diagramTemplateName: "",
resultTypeFields: []
},
{
type: "aggregatedGeometry",
includeGeometry: false,
includePropagatedValues: false,
networkAttributeNames: [],
diagramTemplateName: "",
resultTypeFields: []
}
],
traceType: "subnetwork"
});
traceParameters.traceLocations = [traceLocation];
const jobInfo = await network.submitTraceJob(traceParameters);
await jobInfo.waitForJobCompletion();

Type definitions

TraceJobStatus

Type definition
Type
"job-waiting" | "job-executing" | "job-succeeded"

WaitForValidateOptions

Type definition

interval

Property
Type
number | undefined

The time in millisecond between remote job status requests.

Default value
1000

statusCallback

Property
Type
(result: TraceJobInfo) => void | undefined

Callback function that is called at the specified interval. Use this method to monitor job status and messages.