public abstract class ActionXCommand<T> extends WorkflowXCommand<Void>
Modifier and Type | Class and Description |
---|---|
static class |
ActionXCommand.ActionExecutorContext
Workflow action executor context
|
Modifier and Type | Field and Description |
---|---|
protected static String |
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 |
---|
ActionXCommand(String name,
String type,
int priority) |
Modifier and Type | Method and Description |
---|---|
protected void |
addActionCron(String type,
Instrumentation.Cron cron)
Adding a cron for the instrumentation time for the given Instrumentation
group
|
void |
failJob(ActionExecutor.Context context)
Fail the job due to failed action
|
void |
failJob(ActionExecutor.Context context,
WorkflowActionBean action)
Fail the job due to failed action
|
protected void |
handleError(ActionExecutor.Context context,
ActionExecutor executor,
String message,
boolean isStart,
WorkflowAction.Status status)
Takes care of errors.
|
protected void |
handleNonTransient(ActionExecutor.Context context,
ActionExecutor executor,
WorkflowAction.Status status)
Takes care of non transient failures.
|
protected boolean |
handleTransient(ActionExecutor.Context context,
ActionExecutor executor,
WorkflowAction.Status status)
Takes care of Transient failures.
|
boolean |
handleUserRetry(WorkflowActionBean action)
Execute retry for action if this action is eligible for user-retry
|
protected void |
incrActionCounter(String type,
int count)
Increment the action counter in the instrumentation log.
|
generateEvent, generateEvent, generateEvent, updateParentIfNecessary, updateParentIfNecessary
call, call, eagerLoadState, eagerVerifyPrecondition, execute, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isLockRequired, isReQueueRequired, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString, verifyPrecondition
protected static final String RECOVERY_ID_SEPARATOR
public ActionXCommand(String name, String type, int priority)
protected boolean handleTransient(ActionExecutor.Context context, ActionExecutor executor, WorkflowAction.Status status) throws CommandException
context
- the execution context.executor
- the executor instance being used.status
- the status to be set for the action.CommandException
- thrown if unable to handle transientprotected void handleNonTransient(ActionExecutor.Context context, ActionExecutor executor, WorkflowAction.Status status) throws CommandException
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(ActionExecutor.Context context, ActionExecutor executor, String message, boolean isStart, WorkflowAction.Status status) throws CommandException
ActionEndCommand
is queued. For errors while attempting to end the action, the job state is updated.
context
- the execution context.executor
- the executor instance being used.message
- isStart
- whether the error was generated while starting or ending an action.status
- the status to be set for the action.CommandException
- thrown if unable to handle action errorpublic void failJob(ActionExecutor.Context context) throws CommandException
context
- the execution context.CommandException
- thrown if unable to fail jobpublic void failJob(ActionExecutor.Context context, WorkflowActionBean action) throws CommandException
context
- the execution context.action
- the action that caused the workflow to failCommandException
- thrown if unable to fail jobpublic boolean handleUserRetry(WorkflowActionBean action) throws CommandException
context
- the execution context.CommandException
- thrown if unable to fail jobprotected void incrActionCounter(String type, int count)
protected void addActionCron(String type, Instrumentation.Cron cron)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.