@Override
public void rerunChildren() throws CommandException {
boolean isError = false;
try {
CoordinatorActionInfo coordInfo = null;
InstrumentUtils.incrJobCounter(getName(), 1, getInstrumentation());
List<CoordinatorActionBean> coordActions;
if (rerunType.equals(RestConstants.JOB_COORD_RERUN_DATE)) {
coordActions = getCoordActionsFromDates(jobId, scope);
}
else if (rerunType.equals(RestConstants.JOB_COORD_RERUN_ACTION)) {
coordActions = getCoordActionsFromIds(jobId, scope);
}
else {
isError = true;
throw new CommandException(ErrorCode.E1018, "date or action expected.");
}
if (checkAllActionsRunnable(coordActions)) {
for (CoordinatorActionBean coordAction : coordActions) {
String actionXml = coordAction.getActionXml();
if (!noCleanup) {
Element eAction = XmlUtils.parseXml(actionXml);
cleanupOutputEvents(eAction, coordJob.getUser(), coordJob.getGroup());
}
if (refresh) {
refreshAction(coordJob, coordAction);
}
updateAction(coordJob, coordAction, actionXml);
queue(new CoordActionNotificationXCommand(coordAction), 100);
queue(new CoordActionInputCheckXCommand(coordAction.getId()), 100);
}
}
else {
isError = true;
throw new CommandException(ErrorCode.E1018, "part or all actions are not eligible to rerun!");
}
coordInfo = new CoordinatorActionInfo(coordActions);
ret = coordInfo;
}
catch (XException xex) {
isError = true;