public class ForkedActionStartXCommand extends ActionStartXCommand
ActionXCommand.ActionExecutorContext, ActionXCommand.ForkedActionExecutorContext
actionId, context, COULD_NOT_START, EL_ERROR, EL_EVAL_ERROR, EXEC_DATA_MISSING, START_DATA_MISSING, wfAction, wfJob
RECOVERY_ID_SEPARATOR
INSTR_FAILED_JOBS_COUNTER_NAME, INSTR_KILLED_JOBS_COUNTER_NAME, INSTR_SUCCEEDED_JOBS_COUNTER_NAME
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, LOG
Constructor and Description |
---|
ForkedActionStartXCommand(String actionId,
String type) |
ForkedActionStartXCommand(WorkflowJobBean wfJob,
String id,
String type) |
Modifier and Type | Method and Description |
---|---|
protected void |
callActionEnd() |
protected void |
endWF() |
protected ActionXCommand.ActionExecutorContext |
execute()
Command execution body.
|
void |
failJob(ActionExecutor.Context context,
WorkflowActionBean action)
Fail the job due to failed action
|
protected ActionXCommand.ActionExecutorContext |
getContext(boolean isRetry,
boolean isUserRetry)
Get action executor context
|
String |
getEntityKey()
Return the entity key for the command.
|
protected void |
handleError(ActionXCommand.ActionExecutorContext context,
WorkflowJobBean workflow,
WorkflowActionBean action) |
protected void |
handleNonTransient(ActionExecutor.Context context,
ActionExecutor executor,
WorkflowAction.Status status)
Takes care of non transient failures.
|
protected void |
queue(XCommand<?> command,
long msDelay)
Queue a command for delayed execution after the current command execution completes.
|
protected void |
updateJobLastModified() |
protected void |
updateParentIfNecessary(WorkflowJobBean wfjob,
int maxRetries) |
getKey, isLockRequired, loadState, queueCommandForTransientFailure, setLogInfo, verifyPrecondition
addActionCron, failJob, handleError, handleTransient, handleUserRetry, incrActionCounter
generateEvent, generateEvent, generateEvent, updateParentIfNecessary
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getInstrumentation, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isReQueueRequired, queue, resetUsed, setInterruptMode, toString
public ForkedActionStartXCommand(String actionId, String type)
public ForkedActionStartXCommand(WorkflowJobBean wfJob, String id, String type)
protected ActionXCommand.ActionExecutorContext execute() throws CommandException
XCommand
This method will be invoked after the {link #loadState} and {link #verifyPrecondition} methods.
If the command requires locking, this method will be invoked ONLY if the lock has been acquired.
execute
in class ActionStartXCommand
CommandException
- thrown if the command execution failed.public String getEntityKey()
XCommand
getEntityKey
in interface XCallable<ActionXCommand.ActionExecutorContext>
getEntityKey
in class ActionStartXCommand
protected void queue(XCommand<?> command, long msDelay)
XCommand
All commands queued during the execution of the current command with the same delay will be queued for a single serial execution.
If the command execution throws an exception, no command will be effectively queued.
queue
in class ActionStartXCommand
command
- command to queue.msDelay
- delay in milliseconds.public void failJob(ActionExecutor.Context context, WorkflowActionBean action) throws CommandException
ActionXCommand
failJob
in class ActionXCommand<ActionXCommand.ActionExecutorContext>
context
- the execution context.action
- the action that caused the workflow to failCommandException
- thrown if unable to fail jobprotected void updateParentIfNecessary(WorkflowJobBean wfjob, int maxRetries) throws CommandException
updateParentIfNecessary
in class WorkflowXCommand<ActionXCommand.ActionExecutorContext>
CommandException
protected void handleNonTransient(ActionExecutor.Context context, ActionExecutor executor, WorkflowAction.Status status) throws CommandException
ActionXCommand
handleNonTransient
in class ActionXCommand<ActionXCommand.ActionExecutorContext>
context
- the execution context.executor
- the executor instance being used.status
- the status to be set for the action.CommandException
- thrown if unable to suspend jobprotected void handleError(ActionXCommand.ActionExecutorContext context, WorkflowJobBean workflow, WorkflowActionBean action) throws CommandException
handleError
in class ActionStartXCommand
CommandException
protected void updateJobLastModified()
updateJobLastModified
in class ActionStartXCommand
protected void endWF()
endWF
in class ActionStartXCommand
protected void callActionEnd()
callActionEnd
in class ActionStartXCommand
protected ActionXCommand.ActionExecutorContext getContext(boolean isRetry, boolean isUserRetry)
ActionStartXCommand
getContext
in class ActionStartXCommand
Copyright © 2018 Apache Software Foundation. All rights reserved.