ActionExecution
pentaho.action.impl.Target ActionExecution
The Target.ActionExecution
class is an inner class of Target
that assumes that that the execution target
is a Target
.
It provides an implementation of Execution
which delegates to the event observers of each of the execution phases, by calling the correspondingly named methods of target: Target#_emitActionPhaseInitEvent
, Target#_emitActionPhaseWillEvent
Target#_emitActionPhaseDoEvent
and Target#_emitActionPhaseFinallyEvent
.
Extends
Constructor
Name | Description |
---|---|
new ActionExecution(action, target) | Creates an action execution instance for a given action and target. |
Members
Name | Description |
---|---|
__isInside : | Indicates if currently calling any of the methods: |
action : Abstract | Gets the action of the action execution. |
base : Protected | If a method has been overridden, then the base method provides access to the overridden method. |
error : | Gets the reason for a rejected action execution, or |
isCanceled : | Gets a value that indicates if the action execution has been canceled. |
isDone : | Gets a value that indicates if the action execution completed successfully. |
isExecuting : | Gets a value that indicates if the action execution is executing. |
isFailed : | Gets a value that indicates if the action execution has failed. |
isFinished : | Gets a value that indicates if the action execution has finished. |
isRejected : | Gets a value that indicates if the action execution has been rejected. |
isSettled : | Gets a value that indicates if the action execution has been settled. |
isSync : | Gets a value that indicates if the execution is synchronous. |
isUnstarted : | Gets a value that indicates if the action execution is in the |
promise : | Gets a promise for the result (or error) of this action execution. |
result : | Gets the result of a successful action execution, if any. |
state : | Gets the current action execution state. |
target : Abstract | Gets the target of the action execution. |
Methods
Name | Description |
---|---|
_doDefault() : Promise Protected | Performs the default "execution" for the associated action. |
_lockAction() Protected | Locks the action. |
_onPhaseDo() : Promise Protected | Called during the action's do phase. |
_onPhaseFinally() Protected | Called during the action's finally phase. |
_onPhaseInit() Protected | Called during the action execution's initialize phase. |
_onPhaseWill() Protected | Called during the action execution's will phase. |
_validate() : Array.< Protected | Validates that the action execution is valid for entering the |
done(result) : pentaho.type.action.Execution | Called from an action observer to settle the action execution as being done, optionally giving a result value. |
execute() : pentaho.type.action.Execution | Executes the action. |
executeWill() : pentaho.type.action.Execution | Executes up to the 'will' phase of the action. |
extend(source, keyArgs) : object | Extend an object with the properties of another. |
reject(reason) : pentaho.type.action.Execution | Called to settle the action execution as rejected. |
Constructor Details
new ActionExecution(action, target) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Creates an action execution instance for a given action and target. Source: javascript/web/pentaho/action/impl/Target.js, line 51
|
Members Details
__isInside: |
---|
Indicates if currently calling any of the methods: Source: javascript/web/pentaho/action/Execution.js, line 202 Inherited From: pentaho.action.Execution#__isInside Default Value: false See also: pentaho.action.Execution#__callInside |
action: Abstract |
---|
Gets the action of the action execution. Once the action execution enters the Source: javascript/web/pentaho/action/Execution.js, line 229 Inherited From: pentaho.action.Execution#action |
base: Protected |
---|
If a method has been overridden, then the base method provides access to the overridden method. Can also be called from within a constructor function. Source: javascript/web/pentaho/lang/Base.js, line 299 Inherited From: pentaho.lang.Base#base |
error: |
---|
Gets the reason for a rejected action execution, or This property only returns a non-null value if Source: javascript/web/pentaho/action/Execution.js, line 323 Inherited From: pentaho.action.Execution#error |
isCanceled: |
---|
Gets a value that indicates if the action execution has been canceled. An action execution is considered canceled if its state has the Source: javascript/web/pentaho/action/Execution.js, line 391 Inherited From: pentaho.action.Execution#isCanceled See also: pentaho.type.action.Execution#isRejected |
isDone: |
---|
Gets a value that indicates if the action execution completed successfully. An action execution is considered done if its state has the Source: javascript/web/pentaho/action/Execution.js, line 440 Inherited From: pentaho.action.Execution#isDone See also: pentaho.type.action.Execution#isSettled , pentaho.type.action.Execution#result |
isExecuting: |
---|
Gets a value that indicates if the action execution is executing. An action execution is considered executing if it has started but not yet finished, i.e., if its state is not the Source: javascript/web/pentaho/action/Execution.js, line 424 Inherited From: pentaho.action.Execution#isExecuting See also: pentaho.type.action.Execution#isUnstarted , pentaho.type.action.Execution#isFinished |
isFailed: |
---|
Gets a value that indicates if the action execution has failed. An action execution is considered failed if its state has the Source: javascript/web/pentaho/action/Execution.js, line 406 Inherited From: pentaho.action.Execution#isFailed See also: pentaho.type.action.Execution#isRejected |
isFinished: |
---|
Gets a value that indicates if the action execution has finished. An action execution is considered finished if its state has the When finished, one of the bits Source: javascript/web/pentaho/action/Execution.js, line 462 Inherited From: pentaho.action.Execution#isFinished See also: pentaho.type.action.Execution#isSettled |
isRejected: |
---|
Gets a value that indicates if the action execution has been rejected. An action execution is considered rejected if its state has one of the following bits on: Source: javascript/web/pentaho/action/Execution.js, line 376 Inherited From: pentaho.action.Execution#isRejected See also: pentaho.type.action.Execution#isCanceled , pentaho.type.action.Execution#isFailed , pentaho.type.action.Execution#isDone , pentaho.type.action.Execution#isSettled , pentaho.type.action.Execution#error |
isSettled: |
---|
Gets a value that indicates if the action execution has been settled. An action execution is considered settled if its state has one of the following bits on: When an execution is settled it may not yet be [finished]{@see pentaho.type.action.Execution#isFinished}. Source: javascript/web/pentaho/action/Execution.js, line 356 Inherited From: pentaho.action.Execution#isSettled See also: pentaho.type.action.Execution#isCanceled , pentaho.type.action.Execution#isFailed , pentaho.type.action.Execution#isDone |
isSync: |
---|
Gets a value that indicates if the execution is synchronous. Source: javascript/web/pentaho/action/Execution.js, line 248 Inherited From: pentaho.action.Execution#isSync |
isUnstarted: |
---|
Gets a value that indicates if the action execution is in the Source: javascript/web/pentaho/action/Execution.js, line 334 Inherited From: pentaho.action.Execution#isUnstarted |
promise: |
---|
Gets a promise for the result (or error) of this action execution. This promise can be requested anytime, before the execution has started, during execution, or after execution has finished. It can also be requested whether or not the associated action is The promise is fulfilled with the action execution's Source: javascript/web/pentaho/action/Execution.js, line 485 Inherited From: pentaho.action.Execution#promise |
result: |
---|
Gets the result of a successful action execution, if any. This property only returns a non-undefined value if Source: javascript/web/pentaho/action/Execution.js, line 310 Inherited From: pentaho.action.Execution#result |
state: |
---|
Gets the current action execution state. Source: javascript/web/pentaho/action/Execution.js, line 279 Inherited From: pentaho.action.Execution#state See also: pentaho.type.action.Execution#isUnstarted , pentaho.type.action.Execution#isExecuting , pentaho.type.action.Execution#isSettled , pentaho.type.action.Execution#isDone , pentaho.type.action.Execution#isRejected , pentaho.type.action.Execution#isCanceled , pentaho.type.action.Execution#isFailed , pentaho.type.action.Execution#isFinished |
target: Abstract |
---|
Gets the target of the action execution. Source: javascript/web/pentaho/action/Execution.js, line 252 Inherited From: pentaho.action.Execution#target |
Methods Details
_doDefault() : Promise Protected | ||||
---|---|---|---|---|
Performs the default "execution" for the associated action. When the associated action is Source: javascript/web/pentaho/action/Execution.js, line 615 Inherited From: pentaho.action.Execution#_doDefault
|
_lockAction() Protected |
---|
Locks the action. The default implementation locks the action by using the Source: javascript/web/pentaho/action/Execution.js, line 891 Inherited From: pentaho.action.Execution#_lockAction |
_onPhaseDo() : Promise Protected | ||||
---|---|---|---|---|
Called during the action's do phase. The default implementation does nothing. Source: javascript/web/pentaho/action/Execution.js, line 1052 Inherited From: pentaho.action.Execution#_onPhaseDo
|
_onPhaseFinally() Protected |
---|
Called during the action's finally phase. The default implementation does nothing. Source: javascript/web/pentaho/action/Execution.js, line 1063 Inherited From: pentaho.action.Execution#_onPhaseFinally |
_onPhaseInit() Protected |
---|
Called during the action execution's initialize phase. The default implementation does nothing. Source: javascript/web/pentaho/action/Execution.js, line 1029 Inherited From: pentaho.action.Execution#_onPhaseInit |
_onPhaseWill() Protected |
---|
Called during the action execution's will phase. The default implementation does nothing. Source: javascript/web/pentaho/action/Execution.js, line 1039 Inherited From: pentaho.action.Execution#_onPhaseWill |
_validate() : Array.< Protected | ||||
---|---|---|---|---|
Validates that the action execution is valid for entering the The default implementation validates the action. Source: javascript/web/pentaho/action/Execution.js, line 903 Inherited From: pentaho.action.Execution#_validate
|
done(result) : pentaho.type.action.Execution | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called from an action observer to settle the action execution as being done, optionally giving a result value. Source: javascript/web/pentaho/action/Execution.js, line 631 Inherited From: pentaho.action.Execution#done
|
execute() : pentaho.type.action.Execution | ||||
---|---|---|---|---|
Executes the action. When the associated action is Source: javascript/web/pentaho/action/Execution.js, line 540 Inherited From: pentaho.action.Execution#execute
|
executeWill() : pentaho.type.action.Execution | ||||
---|---|---|---|---|
Executes up to the 'will' phase of the action. Source: javascript/web/pentaho/action/Execution.js, line 562 Inherited From: pentaho.action.Execution#executeWill
|
extend(source, keyArgs) : object | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Extend an object with the properties of another. Methods that are overridden are accessible through This object is extended, but its class doesn't change. Source: javascript/web/pentaho/lang/Base.js, line 1040 Inherited From: pentaho.lang.Base#extend
|
reject(reason) : pentaho.type.action.Execution | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called to settle the action execution as rejected. The execution is considered failed if Otherwise, the execution is considered canceled if When unstarted, the execution's 'finally' phase is run. Otherwise, it is run later, when the execution reaches that phase. Source: javascript/web/pentaho/action/Execution.js, line 704 Inherited From: pentaho.action.Execution#reject
See also: pentaho.type.action.Execution#isRejected , pentaho.type.action.Execution#isCanceled , pentaho.type.action.Execution#isFailed , pentaho.type.action.Execution#error Example define([ "pentaho/lang/UserError", "pentaho/lang/RuntimeError" ], function(UserError, RuntimeError) { // ... target.on("fly", { will: function(event) { // Canceling the action execution // - Method 1 event.reject("Cannot do this action now."); // - Method 2 event.reject(new UserError("Cannot do this action now.")); // Failing the action execution // - Method 1 (message is not adequate to be shown to the user): event.reject(new Error("Null Pointer Exception.")); // - Method 2 (message is adequate to be shown to the user): event.reject(new RuntimeError("The server is currently unreachable.")); } }); // ... }); |