| Package | com.esri.ags.tasks |
| Class | public class Geoprocessor |
| Inheritance | Geoprocessor BaseTask flash.events.EventDispatcher |
getInput - checks status of the job identified by jobId. The only applicable events are getInputComplete and fault.getResultData - checks status of the job identified by jobId. The only applicable events are getResultDataComplete and fault.getResultImageLayer - checks status of the job identified by jobId. The only applicable events are getResultImageComplete and fault.checkStatus - checks status of the job identified by jobId. The only applicable events are statusUpdate and fault.Set the url to the ArcGIS Server REST resource that represents a Geoprocessor service, e.g. http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygons. For more information on constructing a URL, see Using the ArcGIS Services Directory.
var mapPoint:Geometry = new MapPoint(-20, -10);
var featureSet:FeatureSet = new FeatureSet();
featureSet.features = [ { geometry: mapPoint } ];
var params:Object = new Object();
params.Input_Point = featureSet;
params.Days = 10;
var gp:Geoprocessor = new Geoprocessor();
gp.url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_Currents_World/GPServer/MessageInABottle";
gp.execute(params);
gp.addEventListener(GeoprocessorEvent.EXECUTE_COMPLETE, executeCompleteHandler);
gp.addEventListener(FaultEvent.FAULT, faultHandler);See also
| Property | Defined by | ||
|---|---|---|---|
![]() | concurrency : String = "multiple"
Value that indicates how to handle multiple calls to the same task.
| BaseTask | |
![]() | disableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from
being loaded from the browser's cache.
| BaseTask | |
| executeLastResult : ExecuteResult
[Synchronous] The result from the last execute call.
| Geoprocessor | ||
| getInputLastResult : ParameterValue
[Asynchronous] The result from the last getInput call.
| Geoprocessor | ||
| getResultDataLastResult : ParameterValue
[Asynchronous] The result from the last getResultData call.
| Geoprocessor | ||
| getResultImageLastResult : ParameterValue
[Asynchronous] The result from the last getResultImage call.
| Geoprocessor | ||
| outputSpatialReference : SpatialReference
The well-known ID of the spatial reference of the output geometries.
| Geoprocessor | ||
| processSpatialReference : SpatialReference
The well-known ID of the spatial reference that the model will use to perform geometry operations.
| Geoprocessor | ||
![]() | proxyURL : String
The URL to proxy the request through.
| BaseTask | |
![]() | requestTimeout : Number = -1
The request timeout in seconds.
| BaseTask | |
![]() | showBusyCursor : Boolean = false
If true, a busy cursor is displayed while a service is executing.
| BaseTask | |
| submitJobLastResult : JobInfo
[Asynchronous] The result from the last submitJob call.
| Geoprocessor | ||
![]() | token : String
Token for accessing a secure task.
| BaseTask | |
| updateDelay : Number
[Asynchronous] The time interval in milliseconds between each job status request sent to an asynchronous geoprocessing task.
| Geoprocessor | ||
![]() | url : String
URL of the task.
| BaseTask | |
| Method | Defined by | ||
|---|---|---|---|
|
Geoprocessor(url:String = null)
Creates a new Geoprocessor object that represents the geoprocessing task.
| Geoprocessor | ||
|
cancelJobStatusUpdates(jobId:String):void
Cancels the periodic job status updates initiated automatically when
submitJob() is invoked
for the job identified by jobId. | Geoprocessor | ||
|
checkJobStatus(jobId:String, responder:IResponder = null):AsyncToken
Sends a request to the geoprocessing task for the current state of the job identified by jobId.
| Geoprocessor | ||
|
execute(inputParameters:Object, responder:IResponder = null):AsyncToken
[Synchronous] Sends a request to the server to execute a synchronous geoprocessing task.
| Geoprocessor | ||
|
getInput(jobId:String, parameterName:String, responder:IResponder = null):AsyncToken
[Asynchronous] Sends a request to the server...
| Geoprocessor | ||
|
getResultData(jobId:String, parameterName:String, responder:IResponder = null):AsyncToken
[Asynchronous] Sends a request to the Geoprocessor task to get the task result identified by jobId and resultParameterName.
| Geoprocessor | ||
|
getResultImage(jobId:String, parameterName:String, imageParameters:ImageParameters, responder:IResponder = null):AsyncToken
[Asynchronous] Sends a request to the geoprocessing task to get the task result identified by jobId and resultParameterName as an image.
| Geoprocessor | ||
|
getResultImageLayer(jobId:String, parameterName:String, imageParameters:ImageParameters = null):GPResultImageLayer
[Asynchronous] Creates and configures a GPResultImageLayer instance ready to be added to a Map.
| Geoprocessor | ||
|
submitJob(inputParameters:Object, responder:IResponder = null, statusResponder:IResponder = null):AsyncToken
[Asynchronous] Submits a job request to the server to execute an asynchronous geoprocessing task.
| Geoprocessor | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when an execute operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| Dispatched when a Geoprocessor request fails. | Geoprocessor | |||
| Dispatched when a getInput operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| Dispatched when a getResultData operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| Dispatched when a getResultImage operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| Dispatched when a submitJob operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| Dispatched when a checkStatus operation of the geoprocessing task successfully completes. | Geoprocessor | |||
| executeLastResult | property |
public var executeLastResult:ExecuteResult[Synchronous] The result from the last execute call.
This property can be used as the source for data binding.
| getInputLastResult | property |
public var getInputLastResult:ParameterValue[Asynchronous] The result from the last getInput call.
This property can be used as the source for data binding.
| getResultDataLastResult | property |
public var getResultDataLastResult:ParameterValue[Asynchronous] The result from the last getResultData call.
This property can be used as the source for data binding.
| getResultImageLastResult | property |
public var getResultImageLastResult:ParameterValue[Asynchronous] The result from the last getResultImage call.
This property can be used as the source for data binding.
| outputSpatialReference | property |
outputSpatialReference:SpatialReference [read-write]The well-known ID of the spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries. If processSpatialReferencew is specified and outputSpatialReference is not specified, the output geometries are in the spatial reference of the process spatial reference.
This property can be used as the source for data binding.
Implementation public function get outputSpatialReference():SpatialReference
public function set outputSpatialReference(value:SpatialReference):void
| processSpatialReference | property |
processSpatialReference:SpatialReference [read-write]The well-known ID of the spatial reference that the model will use to perform geometry operations. If processSpatialReference is specified and outputSpatialReference is not specified, the output geometries are in the spatial reference of the process spatial reference.
This property can be used as the source for data binding.
Implementation public function get processSpatialReference():SpatialReference
public function set processSpatialReference(value:SpatialReference):void
| submitJobLastResult | property |
public var submitJobLastResult:JobInfo[Asynchronous] The result from the last submitJob call.
This property can be used as the source for data binding.
| updateDelay | property |
updateDelay:Number [read-write][Asynchronous] The time interval in milliseconds between each job status request sent to an asynchronous geoprocessing task.
The default value is 1000 milliseconds.
This property can be used as the source for data binding.
Implementation public function get updateDelay():Number
public function set updateDelay(value:Number):void
| Geoprocessor | () | constructor |
public function Geoprocessor(url:String = null)Creates a new Geoprocessor object that represents the geoprocessing task.
Parametersurl:String (default = null) — The URL of the geoprocessing task.
|
| cancelJobStatusUpdates | () | method |
public function cancelJobStatusUpdates(jobId:String):void
Cancels the periodic job status updates initiated automatically when submitJob() is invoked
for the job identified by jobId. You can still obtain the status of this job by calling
the checkStatus() method at your own discretion.
jobId:String |
| checkJobStatus | () | method |
public function checkJobStatus(jobId:String, responder:IResponder = null):AsyncTokenSends a request to the geoprocessing task for the current state of the job identified by jobId. Upon receiving the response, the statusUpdate event is fired and the optional callback function is invoked.
ParametersjobId:String — A string that uniquely identifies a job on the server.
It is created when a job is submitted for execution and later used to check its status and retrieve the results.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
| execute | () | method |
public function execute(inputParameters:Object, responder:IResponder = null):AsyncToken[Synchronous] Sends a request to the server to execute a synchronous geoprocessing task. On completion, the executeComplete event is fired and the optional callback function is invoked.
ParametersinputParameters:Object — The inputParameters argument specifies the input parameters accepted by the
task and their corresponding values. These input parameters are listed in the parameters field of
the associated geoprocessing task resource.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
See also
| getInput | () | method |
public function getInput(jobId:String, parameterName:String, responder:IResponder = null):AsyncToken[Asynchronous] Sends a request to the server... On completion, the getInputComplete event is fired and the optional callback function is invoked.
ParametersjobId:String — A string that uniquely identifies a job on the server.
It is created when a job is submitted for execution and later used to check its status and retrieve the results.
|
|
parameterName:String — The responder to call for status.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
| getResultData | () | method |
public function getResultData(jobId:String, parameterName:String, responder:IResponder = null):AsyncToken[Asynchronous] Sends a request to the Geoprocessor task to get the task result identified by jobId and resultParameterName. On completion, the getResultDataComplete event is fired and the optional callback function is invoked.
ParametersjobId:String — A string that uniquely identifies a job on the server.
It is created when a job is submitted for execution and later used to check its status and retrieve the results.
|
|
parameterName:String — The responder to call for status.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
| getResultImage | () | method |
public function getResultImage(jobId:String, parameterName:String, imageParameters:ImageParameters, responder:IResponder = null):AsyncToken[Asynchronous] Sends a request to the geoprocessing task to get the task result identified by jobId and resultParameterName as an image. This gives you a static image instead of a map layer. The image cannot be added to the map.
ParametersjobId:String — The jobId returned from JobInfo.
|
|
parameterName:String — The name of the result parameter as defined in ArcGIS Services Directory.
|
|
imageParameters:ImageParameters — Specifies the properties of the result image.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
AsyncToken |
| getResultImageLayer | () | method |
public function getResultImageLayer(jobId:String, parameterName:String, imageParameters:ImageParameters = null):GPResultImageLayer[Asynchronous] Creates and configures a GPResultImageLayer instance ready to be added to a Map.
ParametersjobId:String — The jobId returned from JobInfo.
|
|
parameterName:String — The name of the result parameter as defined in ArcGIS Services Directory.
|
|
imageParameters:ImageParameters (default = null) — Contains various options that can be specified when generating a dynamic map image.
|
GPResultImageLayer —
A new GPResultImageLayer.
|
| submitJob | () | method |
public function submitJob(inputParameters:Object, responder:IResponder = null, statusResponder:IResponder = null):AsyncToken[Asynchronous] Submits a job request to the server to execute an asynchronous geoprocessing task. On completion, the jobComplete event is fired and optional callback functions are invoked.
ParametersinputParameters:Object — The inputParameters argument specifies the input parameters accepted by the
task and their corresponding values. These input parameters are listed in the parameters field of
the associated geoprocessing task resource.
|
|
responder:IResponder (default = null) — The responder to call on result or fault.
|
|
statusResponder:IResponder (default = null) — The responder to call on status updates.
|
AsyncToken |
See also
| executeComplete | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.EXECUTE_COMPLETE
Dispatched when an execute operation of the geoprocessing task successfully completes. This only applies to tasks submitted with the execute method (not the submitJob method).
Defines the value of the type property of an executeComplete event object.
| fault | event |
mx.rpc.events.FaultEvent
Dispatched when a Geoprocessor request fails. Applies to all methods.
| getInputComplete | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.GET_INPUT_COMPLETE
Dispatched when a getInput operation of the geoprocessing task successfully completes.
Defines the value of the type property of a getInputComplete event object.
| getResultDataComplete | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.GET_RESULT_DATA_COMPLETE
Dispatched when a getResultData operation of the geoprocessing task successfully completes.
Defines the value of the type property of a getResultDataComplete event object.
| getResultImageComplete | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.GET_RESULT_IMAGE_COMPLETE
Dispatched when a getResultImage operation of the geoprocessing task successfully completes.
Defines the value of the type property of a getResultImageComplete event object.
| jobComplete | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.JOB_COMPLETE
Dispatched when a submitJob operation of the geoprocessing task successfully completes.
Defines the value of the type property of a jobComplete event object.
| statusUpdate | event |
com.esri.ags.events.GeoprocessorEvent
com.esri.ags.events.GeoprocessorEvent.STATUS_UPDATE
Dispatched when a checkStatus operation of the geoprocessing task successfully completes. This only applies to tasks submitted with the submitJob method (not the execute method).
Defines the value of the type property of a statusUpdate event object.