| Package | com.adobe.cairngorm.commands |
| Class | public class SequenceCommand |
| Implements | ICommand |
By extending SequenceCommand, you can specify the event that should be broadcast to the controller (causing another command execution without a further user-gesture) when the current command has completed execution.
For a command implementing the Responder interface, you may choose to sequence a subsequent command on successful completion of the command, in the onResult() handler, or on failure of the command in the onFault() method.
For commands that do not implement the Responder interface, you can simply chain commands by causing the sequenced command to be invoked as the last action in your command's execute() method.
Usage
In the constructor of a concrete SequenceCommand implementation, you should set nextEvent to the event that is responsible for calling your subsequent command.
Alternatively, you can override the implicit nextEvent getter, to programmatically decide at runtime which event should be broadcast next.
Invocation of the next command in the sequence is explicitly controlled by the developer, by calling the executeNextCommand() method provided in the SequenceCommand base-class. This can be called either in the body of the execute() method (for synchronous sequencing) or in the body of an onResult() or onFault() handler (for asynchronous sequencing, that can also support conditional workflow).
See also
| Property | Defined by | ||
|---|---|---|---|
| nextEvent : CairngormEvent
The next event in the sequence.
| SequenceCommand | ||
| Method | Defined by | ||
|---|---|---|---|
|
SequenceCommand(nextEvent:CairngormEvent = null)
Constructor, with optional nextEvent.
| SequenceCommand | ||
|
execute(event:CairngormEvent):void
Abstract implementation of the execute() method.
| SequenceCommand | ||
|
executeNextCommand():void
Call to execute the next command in the sequence.
| SequenceCommand | ||
| nextEvent | property |
public var nextEvent:CairngormEventThe next event in the sequence.
| SequenceCommand | () | constructor |
public function SequenceCommand(nextEvent:CairngormEvent = null)Constructor, with optional nextEvent.
ParametersnextEvent:CairngormEvent (default = null) |
| execute | () | method |
public function execute(event:CairngormEvent):voidAbstract implementation of the execute() method.
ActionScript does not explicity support abstract methods and abstract classes, so this concrete implementation of the interface method must be overridden by the developer.
Parametersevent:CairngormEvent |
| executeNextCommand | () | method |
public function executeNextCommand():voidCall to execute the next command in the sequence.
Called explicitly by the developer within a concrete SequenceCommand implementation, this method causes the event registered with nextEvent to be broadcast, for the next command in the sequence to be called without further user-gesture.