
Task Providers
The TaskProviders list contains providers of tasks to be executed in the batch task. Three types of task providers are allowed in this list—task parameters provider whose value implements the IBATaskParameters interface, task command provider whose value is an instance of the ESRI.ArcGIS.Client.BACore.Client.BACommand class, or task delegate provider whose value is a BatchTaskProvider.Delegate method.
The BatchTaskProvider.Delegate instance receives on input the current context of parameters, prepares parameters of the task to be executed, and returns them or a command instance or another task delegate provider. If it returns null, the batch task processor goes to the next task provider in the list.
If a task delegate provider throws an exception or execution of any task in the batch task fails, the batch task stops execution and notifies its fault event handler.
Other Batch Task Parameters
The CurrentStep property specifies a zero-based index of the step currently executed. Since a task delegate provider has an access to the parameters of the batch task, it can change a step to be executed next by setting the CurrentStep
value to a zero-based index of the step before the next one. For example, if you want to go from the step 3 to 5, set the CurrentStep
value to 4 in the task delegate provider of the step 3.
The SharedData property is intended for sharing data between steps of the batch task. It can be populated with some initial data before executing the batch task and its contents can be updated in a task delegate provider executed at the current step.
Batch task execution results are collected in the Results list. When a step of the batch task is successfully completed, the result of last executed task is appended to the end of this list and becomes available via LastResult property.
Batch Task Director
A special batch task director callback method, onStepComplete
, can be specified in the constructor of this class. It is called at the end of execution of every step of the batch task. When this method is invoked, its completedStep
parameter specifies a zero-based index of the step completed; the parameters.CurrentStep
value specifies a zero-based index of the step to be executed next; and the parameters.LastResult
value contains the result of completion of the last step. This method can perform validation of the last result, logging the execution process, store results in UserState, change a step to be executed next, and so on. In order to complete the whole task after execution a step, set parameters.CurrentStep=parameters.TokenProviders.Count
in the scope of this method.
The onStepComplete
method can throw an exception to prevent execution of the next step. In this case, the execution of the batch task immediately stops and the task fault event handler is notified.
System.Object
ESRI.ArcGIS.Client.BACore.Client.BatchTaskParameters
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family