Packagecom.esri.bacore.tasks
Classpublic class BAQueryTask
InheritanceBAQueryTask Inheritance flash.events.EventDispatcher
Implements IBATask

The BAQueryTask class is a wrapper for the ArcGIS Query task working in the Community Analyst-like style. It additionally supports a token provider and its taskCompleted event returns an instance of the BATaskCompletedEvent object.

See also

BATaskCompletedEvent


Public Properties
 PropertyDefined By
  concurrency : String
Value that indicates how to handle multiple calls to the same task.
BAQueryTask
  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.
BAQueryTask
  lastResult : FeatureSet
[read-only] The last result of execution the ArcGIS Query task.
BAQueryTask
  proxyURL : String
The URL to proxy the request through.
BAQueryTask
  requestTimeout : Number
The request timeout in seconds.
BAQueryTask
  showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing.
BAQueryTask
  token : String
ArcGIS Server token associated with this workflow.
BAQueryTask
  tokenProvider : ITokenProvider
Provider responsible for updating the ArcGIS Server security token if the last one expires.
BAQueryTask
  url : String
A map resource URL to query geographies from.
BAQueryTask
  useAMF : Boolean
Use AMF for execute().
BAQueryTask
Public Methods
 MethodDefined By
  
BAQueryTask(url:String = null)
Creates a new instance of the BAQueryTask class.
BAQueryTask
  
execute(query:Query, responder:IResponder = null):AsyncToken
Executes the workflow quering feature set from ArcGIS Server Map Services.
BAQueryTask
Events
 Event Summary Defined By
  The fault event is dispatched when an asynchronous execution of a query task fails.BAQueryTask
  The taskCompleted event is dispatched when an asynchronous execution of a query task completes successfully.BAQueryTask
Public Constants
 ConstantDefined By
  name : String = BAQuery
[static] Task name.
BAQueryTask
Property Detail
concurrencyproperty
concurrency:String

Value that indicates how to handle multiple calls to the same task. The default value is multiple. The following values are permitted:


Implementation
    public function get concurrency():String
    public function set concurrency(value:String):void

See also

disableClientCachingproperty 
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.

The default value is false.


Implementation
    public function get disableClientCaching():Boolean
    public function set disableClientCaching(value:Boolean):void
lastResultproperty 
lastResult:FeatureSet  [read-only]

The last result of execution the ArcGIS Query task.


Implementation
    public function get lastResult():FeatureSet
proxyURLproperty 
proxyURL:String

The URL to proxy the request through.


Implementation
    public function get proxyURL():String
    public function set proxyURL(value:String):void
requestTimeoutproperty 
requestTimeout:Number

The request timeout in seconds. A value less than or equal to zero prevents request timeout.

The default value is -1.


Implementation
    public function get requestTimeout():Number
    public function set requestTimeout(value:Number):void
showBusyCursorproperty 
showBusyCursor:Boolean

If true, a busy cursor is displayed while a service is executing.

The default value is false.


Implementation
    public function get showBusyCursor():Boolean
    public function set showBusyCursor(value:Boolean):void
tokenproperty 
token:String

ArcGIS Server token associated with this workflow. It is implicetely updated by the ArcGISTokenProvider if the last one is specified.


Implementation
    public function get token():String
    public function set token(value:String):void
tokenProviderproperty 
tokenProvider:ITokenProvider

Provider responsible for updating the ArcGIS Server security token if the last one expires.


Implementation
    public function get tokenProvider():ITokenProvider
    public function set tokenProvider(value:ITokenProvider):void
urlproperty 
url:String

A map resource URL to query geographies from.


Implementation
    public function get url():String
    public function set url(value:String):void
useAMFproperty 
useAMF:Boolean

Use AMF for execute(). Set to false if not using ArcGIS Server 10.0 or above. When useAMF is true, the concurency, requestTimeout, and showBusyCursor properties are ignored.

The default value is false.


Implementation
    public function get useAMF():Boolean
    public function set useAMF(value:Boolean):void
Constructor Detail
BAQueryTask()Constructor
public function BAQueryTask(url:String = null)

Creates a new instance of the BAQueryTask class.

Parameters
url:String (default = null) — The map resource URL to query features from.
Method Detail
execute()method
public function execute(query:Query, responder:IResponder = null):AsyncToken

Executes the workflow quering feature set from ArcGIS Server Map Services.

A response can be received in two ways—in an optional responder object passed in parameters of this method and/or in listeners of fault and taskCompleted events registered for this task.

The responder is notified first when a response is received and parsed. Its fault method receives a parameter of the FaultEvent type and its result method receives a parameter of the BATaskCompletedEvent type whose result property contains the result object. After that the received event is dispatched for listeners of this task.

If a response is successfully received and parsed, the result is assigned to the lastResult property of this task.

Parameters

query:Query — Query parameters.
 
responder:IResponder (default = null) — A responder to call on result or fault.

Returns
AsyncToken — Asynch token to be associated with the response.
Event Detail
fault Event
Event Object Type: mx.rpc.events.FaultEvent
FaultEvent.type property = mx.rpc.events.FaultEvent.FAULT

The fault event is dispatched when an asynchronous execution of a query task fails.

taskCompleted Event  
Event Object Type: com.esri.bacore.BATaskCompletedEvent
BATaskCompletedEvent.type property = com.esri.bacore.BATaskCompletedEvent.COMPLETE

The taskCompleted event is dispatched when an asynchronous execution of a query task completes successfully.

The BATaskCompletedEvent.COMPLETE constant defines the value of the type property of the event object for a taskCompleted event.

The properties of the event object have the following values:

PropertyValue
babblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event.
targetThe BATask object that dispatched the event. This is an instance of a Community Analyst Task that was executed.
taskNameName of a Community Analyst Task that was executed.
resultTask execution result object.
messagesOptional array of TaskMessage objects received.

The currentTarget and target properties are specified after the event was dispatched. A responder object passed in parameters of a Community Analyst Task execute method receives the event before it is dispatched.

Constant Detail
nameConstant
public static const name:String = BAQuery

Task name. This name is used for identification this task only.