diff --git a/common/src/main/java/cz/incad/kramerius/processes/BatchStates.java b/common/src/main/java/cz/incad/kramerius/processes/BatchStates.java index 8b4e5e4384..c219ebd34b 100644 --- a/common/src/main/java/cz/incad/kramerius/processes/BatchStates.java +++ b/common/src/main/java/cz/incad/kramerius/processes/BatchStates.java @@ -81,7 +81,7 @@ public int getVal() { */ public static BatchStates calculateBatchState(List childStates) { // ve stavu planned nebo running - if (States.one(childStates, States.FAILED)) { + if (States.one(childStates, States.FAILED, States.KILLED)) { return BATCH_FAILED; } else if (States.one(childStates,States.WARNING)) { return BATCH_WARNING; diff --git a/search/src/java/cz/incad/Kramerius/LongRunningProcessServlet.java b/search/src/java/cz/incad/Kramerius/LongRunningProcessServlet.java index 5b80d58a43..cfbd83c19c 100644 --- a/search/src/java/cz/incad/Kramerius/LongRunningProcessServlet.java +++ b/search/src/java/cz/incad/Kramerius/LongRunningProcessServlet.java @@ -296,6 +296,21 @@ public void doAction(ServletContext context, HttpServletRequest req, HttpServlet String uuid = req.getParameter("uuid"); String realPath = context.getRealPath("WEB-INF/lib"); LRProcess oProcess = stopOldProcess(realPath, uuid, defManager, lrProcessManager); + + // update parent process + List processes = lrProcessManager.getLongRunningProcessesByGroupToken(oProcess.getGroupToken()); + if (processes.size() > 1) { + LOGGER.fine("calculating new master state"); + List childStates = new ArrayList(); + for (int i = 0, ll = processes.size(); i < ll; i++) { + childStates.add(processes.get(i).getProcessState()); + } + processes.get(0).setBatchState(BatchStates.calculateBatchState(childStates)); + LOGGER.fine("calculated state '"+processes.get(0)+"'"); + lrProcessManager.updateLongRunninngProcessBatchState(processes.get(0)); + } + + StringBuffer buffer = new StringBuffer(); buffer.append(""); buffer.append("
    ");