Packagecom.esri.baserver.tasks.customerstoresetup
Classpublic final class AssignCustomersByClosestStoreTask
InheritanceAssignCustomersByClosestStoreTask Inheritance BAServerTask Inheritance BATask Inheritance AbstractTask Inheritance flash.events.EventDispatcher

The Assign Customers by Closest Store task assigns or reassigns customer features to stores using a straight-line distance to the closest store feature location.

Most Business Analyst Server analyses need you to assign customers contained in the customer datasets either to stores or to trade areas. To create customer-derived trade areas around your customers or to create desire lines, your customer data must contain a field that associates each customer with a particular store. A number of analyses in Business Analyst Server require that your customer data has a store assignment field. If you do not have such a field, you can create one using the Assign Customers by Closest Store task.

Two algorithms for closest store assignment are implemented: direct assignment and assignment based on creation Thiessen polygons. The first algorithm compares the straight-line distance from a customer to every store and selects a store with minimal distance from the customer. The last algorithm first constructs Thiessen equal-competition polygons around stores and then assign all customers to stores based on what polygons they belong to.

The result of this task is a TaskResultOutput object, which is compatible with ArcGIS Server's mapping APIs. FeatureSet and MapImage objects can be returned depending on the task output options requested. Additionally, the output analysis layer can be stored to the Business Analyst Server repository.

See also

AssignCustomersByClosestStoreParameters
TaskResultOutput


Public Properties
 PropertyDefined By
 InheritedactiveDatasetID : String
Active dataset ID.
BAServerTask
 Inheritedconcurrency : String
Value that indicates how to handle multiple calls to the same task.
AbstractTask
 InheriteddisableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.
AbstractTask
 InheritedisFullErrorMessage : Boolean
Produce an error message with stack trace (true) or without stack trace (false).
BAServerTask
  lastResult : TaskResultOutput
[read-only] The last result of executing the Assign Customers by Closest Store task.
AssignCustomersByClosestStoreTask
 InheritedproxyURL : String
The URL to proxy the request through.
AbstractTask
 InheritedrequestTimeout : Number
The request timeout in seconds.
AbstractTask
 InheritedshowBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing.
AbstractTask
 Inheritedtoken : String
Token for accessing a secure task.
AbstractTask
 InheritedtokenProvider : ITokenProvider
Provider responsible for updating the security token if the last one expires.
BATask
 Inheritedurl : String
URL of the task.
AbstractTask
Public Methods
 MethodDefined By
  
AssignCustomersByClosestStoreTask(urlOrClient:Object = null)
Creates a new instance of the AssignCustomersByClosestStoreTask class.
AssignCustomersByClosestStoreTask
  
createCommand(parameters:AssignCustomersByClosestStoreParameters, commandName:String = null):BACommand
Creates a new command encapsulating this task and the given parameters.
AssignCustomersByClosestStoreTask
  
execute(parameters:AssignCustomersByClosestStoreParameters, responder:IResponder = null):AsyncToken
Sends a request for executing an Assign Customers by Closest Store task to the Business Analyst Server HTTP (REST) Service.
AssignCustomersByClosestStoreTask
Events
 Event Summary Defined By
 InheritedThe fault event is dispatched when an asynchronous execution of a Community Analyst Task fails.BATask
 InheritedThe taskCompleted event is dispatched when an asynchronous execution of a Community Analyst Task successfully completes.BATask
Public Constants
 ConstantDefined By
  name : String = AssignCustomersByClosestStore
[static] Task name.
AssignCustomersByClosestStoreTask
Property Detail
lastResultproperty
lastResult:TaskResultOutput  [read-only]

The last result of executing the Assign Customers by Closest Store task.


Implementation
    public function get lastResult():TaskResultOutput
Constructor Detail
AssignCustomersByClosestStoreTask()Constructor
public function AssignCustomersByClosestStoreTask(urlOrClient:Object = null)

Creates a new instance of the AssignCustomersByClosestStoreTask class.

A new task can be constructed in two ways: as a task sharing a BAServerClient type instance with other tasks (the urlOrClient parameter has the BAServerClient type) or as a standalone task encapsulating its own client.

The base URL to the Business Analyst Server HTTP Service looks as follows:

http://{host}:{port}/ArcGIS/baserver/REST/services/DefaultMap/BAServer

The {host} and {port} parameters in this URL should be substituted with valid Business Analyst Server host name and port, respectively.

Parameters
urlOrClient:Object (default = null) — A variable containing either Business Analyst Server HTTP Service base URL string or an instance of the BAServerClient class.

See also

Method Detail
createCommand()method
public function createCommand(parameters:AssignCustomersByClosestStoreParameters, commandName:String = null):BACommand

Creates a new command encapsulating this task and the given parameters.

Parameters

parameters:AssignCustomersByClosestStoreParameters — Parameters of a task to be executed.
 
commandName:String (default = null) — Command name.

Returns
BACommand — A new command.
execute()method 
public function execute(parameters:AssignCustomersByClosestStoreParameters, responder:IResponder = null):AsyncToken

Sends a request for executing an Assign Customers by Closest Store task to the Business Analyst Server HTTP (REST) Service.

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 to listeners of this task.

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

Parameters

parameters:AssignCustomersByClosestStoreParameters — Parameters of the task.
 
responder:IResponder (default = null) — A responder to call on result or fault.

Returns
AsyncToken — Asynch token associated with the response.
Constant Detail
nameConstant
public static const name:String = AssignCustomersByClosestStore

Task name.