Base-class for a tasks that perform some processing and can be placed
inside task groups.
The abstract performTask() method must be implemented by
concrete sub-classes, and the complete() or
fault() methods invoked to indicate that the processing has
completed or failed.
The progress method may optionally be invoked to provide
fine-grained progress updates. The base-class will dispatch an initial and
final progress event for 0% complete and 100% complete, assuming the task
completes successfully.
currentState:String [read-only] Implementation public function get currentState():String
enabled
property
enabled:Boolean Implementation public function get enabled():Boolean public function set enabled(value:Boolean):void
label
property
label:String Implementation public function get label():String public function set label(value:String):void
Method Detail
complete
()
method
protected function complete():void
This should be called by a concrete sub-class to indicate that the
task has been completed. It should only be called once and subsequent
calls are ignored.
fault
()
method
protected function fault(message:String = null):void
This should be called by a concrete sub-class to indicate that the task
has been halted due to a fault. It should only be called once and
subsequent calls are ignored.
Parameters
message:String (default = null) — an optional message describing the cause of the fault
performTask
()
method
protected function performTask():void
This abstract template method must be implemented by a concrete
sub-class to perform the task associated with the task. The task
may be synchronous or asynchronous. When the task is completed, the
complete() method must be called, unless a fault has
occurred, in which case the fault() method must be called
instead.