From 67ee451df2d384375fa9ba9b42ec8708a0dea095 Mon Sep 17 00:00:00 2001 From: Catherine Seppanen Date: Mon, 25 Jan 2016 17:34:34 -0500 Subject: [PATCH] Allow cancelled control strategies to be re-run; display status as Waiting when control strategy hasn't started running yet --- .../editor/EditControlStrategySummaryTab.java | 2 +- .../controlstrategy/editor/EditControlStrategyWindow.java | 1 - .../framework/services/cost/ControlStrategyServiceImpl.java | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategySummaryTab.java b/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategySummaryTab.java index 35e0cf45..c2fb3adc 100644 --- a/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategySummaryTab.java +++ b/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategySummaryTab.java @@ -651,7 +651,7 @@ private Project project(String projectName) throws EmfException { public void setRunMessage(ControlStrategy controlStrategy) { messagePanel.clear(); updateStartDate(controlStrategy); - updateSummaryPanelValuesExceptStartDate("Running", "", null, null); + updateSummaryPanelValuesExceptStartDate("Waiting", "", null, null); } public void refresh(ControlStrategy controlStrategy, ControlStrategyResult[] controlStrategyResults) { diff --git a/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategyWindow.java b/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategyWindow.java index a1946993..910045e4 100644 --- a/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategyWindow.java +++ b/EMF/src/client/gov/epa/emissions/framework/client/cost/controlstrategy/editor/EditControlStrategyWindow.java @@ -355,7 +355,6 @@ else if (selection == JOptionPane.NO_OPTION){ // validatePath(outputTabView.getExportFolder()); controlStrategy.setDeleteResults(deleteResults); controlStrategy.setExportDirectory(outputTabView.getExportFolder()); - controlStrategy.setRunStatus("Waiting"); //get all values from various tabs and persist to strategy object save(); controlStrategy.setStartDate(new Date()); diff --git a/EMF/src/services/gov/epa/emissions/framework/services/cost/ControlStrategyServiceImpl.java b/EMF/src/services/gov/epa/emissions/framework/services/cost/ControlStrategyServiceImpl.java index e017fb8a..7aab7089 100644 --- a/EMF/src/services/gov/epa/emissions/framework/services/cost/ControlStrategyServiceImpl.java +++ b/EMF/src/services/gov/epa/emissions/framework/services/cost/ControlStrategyServiceImpl.java @@ -310,11 +310,6 @@ public synchronized void removeResultDatasets(Integer[] ids, User user) throws E public synchronized void runStrategy(User user, int controlStrategyId) throws EmfException { Session session = sessionFactory.getSession(); try { - // first see if the strategy has been canceled, is so don't run it... - String runStatus = dao.getControlStrategyRunStatus(controlStrategyId, session); - if (runStatus.equals("Cancelled")) - return; - ControlStrategy strategy = getById(controlStrategyId); validateSectors(strategy); //get rid of for now, since we don't auto export anything