INSTR_RECOVERED_ACTIONS_COUNTER, 1);
if (action.getStatus() == WorkflowActionBean.Status.PREP
|| action.getStatus() == WorkflowActionBean.Status.START_MANUAL) {
if (useXCommand) {
queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
} else {
queueCallable(new ActionStartCommand(action.getId(), action.getType()));
}
}
else if (action.getStatus() == WorkflowActionBean.Status.START_RETRY) {
Date nextRunTime = action.getPendingAge();
if (useXCommand) {
queueCallable(new ActionStartXCommand(action.getId(), action.getType()), nextRunTime.getTime()
- System.currentTimeMillis());
} else {
queueCallable(new ActionStartCommand(action.getId(), action.getType()), nextRunTime.getTime()
- System.currentTimeMillis());
}
}
else if (action.getStatus() == WorkflowActionBean.Status.DONE
|| action.getStatus() == WorkflowActionBean.Status.END_MANUAL) {
if (useXCommand) {
queueCallable(new ActionEndXCommand(action.getId(), action.getType()));
} else {
queueCallable(new ActionEndCommand(action.getId(), action.getType()));
}
}
else if (action.getStatus() == WorkflowActionBean.Status.END_RETRY) {
Date nextRunTime = action.getPendingAge();
if (useXCommand) {
queueCallable(new ActionEndXCommand(action.getId(), action.getType()), nextRunTime.getTime()
- System.currentTimeMillis());
} else {
queueCallable(new ActionEndCommand(action.getId(), action.getType()), nextRunTime.getTime()
- System.currentTimeMillis());
}
}
else if (action.getStatus() == WorkflowActionBean.Status.OK
|| action.getStatus() == WorkflowActionBean.Status.ERROR) {
if (useXCommand) {
queueCallable(new SignalXCommand(action.getJobId(), action.getId()));
} else {
queueCallable(new SignalCommand(action.getJobId(), action.getId()));
}
}
else if (action.getStatus() == WorkflowActionBean.Status.USER_RETRY) {
queueCallable(new ActionStartXCommand(action.getId(), action.getType()));
}
}
}
catch (Exception ex) {
log.error("Exception, {0}", ex.getMessage(), ex);