Author: samindaw
Date: Mon Aug 26 01:47:43 2013
New Revision: 1517407

URL: http://svn.apache.org/r1517407
Log:
stop asking to clear monitoring data if no longer worklfow running + clear 
existing monitoring data when running new workflow

Modified:
    
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/EventDataRepository.java
    
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/Monitor.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java

Modified: 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/EventDataRepository.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/EventDataRepository.java?rev=1517407&r1=1517406&r2=1517407&view=diff
==============================================================================
--- 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/EventDataRepository.java
 (original)
+++ 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/EventDataRepository.java
 Mon Aug 26 01:47:43 2013
@@ -111,12 +111,13 @@ public class EventDataRepository impleme
         this.tableModelChangeEvent = new ChangeEvent(this); // We only need 
one.
         this.events = new ArrayList<EventData>();
     }
-
+    public void addEvent(XmlElement message) {
+       addEvent(new EventData(message));
+    }
     /**
      * @param message
      */
-    public void addEvent(XmlElement message) {
-        EventData event = new EventData(message);
+    public void addEvent(EventData event) {
         // no need the check for not null because second clause is evaluated 
only if
         // not null
         if (this.filter == null || this.filter.isAcceptable(event)) {

Modified: 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/Monitor.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/Monitor.java?rev=1517407&r1=1517406&r2=1517407&view=diff
==============================================================================
--- 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/Monitor.java
 (original)
+++ 
airavata/trunk/modules/ws-messenger/message-monitor/src/main/java/org/apache/airavata/ws/monitor/Monitor.java
 Mon Aug 26 01:47:43 2013
@@ -29,6 +29,7 @@ import java.util.Set;
 
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
 import org.apache.airavata.ws.monitor.event.Event;
 import org.apache.airavata.ws.monitor.event.EventProducer;
 import org.apache.airavata.ws.monitor.event.Event.Type;
@@ -57,6 +58,8 @@ public class Monitor extends EventProduc
     private boolean monitoringCompleted=false;
     
     private boolean monitoringFailed=false;
+
+    private String lastTerminatedWorkflowExecutionId=null;
     
     public Monitor(MonitorConfiguration configuration) {
         this.configuration = configuration;
@@ -199,13 +202,17 @@ public class Monitor extends EventProduc
      * @param event
      */
     protected synchronized void handleNotification(XmlElement event) {
+       EventData eventData = new EventData(event);
+       if (eventData.getType()==EventType.WORKFLOW_TERMINATED){
+               lastTerminatedWorkflowExecutionId=eventData.getExperimentID();
+       }
         Set<String> keys = this.eventDataMap.keySet();
         // Remove everthing leaving only the last one
         if(printRawMessages){
             System.out.println(XMLUtil.xmlElementToString(event));
         }
         for (String key : keys) {
-            this.eventDataMap.get(key).addEvent(event);
+            this.eventDataMap.get(key).addEvent(eventData);
         }
     }
 
@@ -278,9 +285,13 @@ public class Monitor extends EventProduc
      * @return
      */
     public boolean isMonitoring() {
-        return monitoring;
+               return monitoring;
     }
 
+       public boolean hasCurrentExecutionTerminatedNotificationReceived() {
+               return getConfiguration().getTopic()!=null && 
getConfiguration().getTopic().equals(lastTerminatedWorkflowExecutionId);
+       }
+
     private void setMonitoring(boolean monitoring) {
         this.monitoring = monitoring;
     }

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java?rev=1517407&r1=1517406&r2=1517407&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
 Mon Aug 26 01:47:43 2013
@@ -84,6 +84,7 @@ public class WorkflowFiler {
 
         this.graphFileChooser = new 
JFileChooser(XBayaPathConstants.WORKFLOW_DIRECTORY);
         this.graphFileChooser.addChoosableFileFilter(this.graphFileFilter);
+        this.graphFileChooser.setFileFilter(this.graphFileFilter);
 
     }
 

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java?rev=1517407&r1=1517406&r2=1517407&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
 Mon Aug 26 01:47:43 2013
@@ -261,6 +261,7 @@ public class WorkflowInterpreterLaunchWi
         this.workflow.setGPELInstanceID(workfowInstanceID);
 
         MonitorConfiguration notifConfig = 
this.engine.getMonitor().getConfiguration();
+        engine.getMonitor().resetEventData();
         notifConfig.setTopic(topic);
         arguments.add("-" + JythonScript.TOPIC_VARIABLE);
         arguments.add(topic);

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java?rev=1517407&r1=1517406&r2=1517407&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
 Mon Aug 26 01:47:43 2013
@@ -312,13 +312,10 @@ public class RunMenuItem  implements Eve
         AbstractAction action = new AbstractAction() {
             private WorkflowInterpreterLaunchWindow window;
             public void actionPerformed(ActionEvent e) {
-                if(engine.getMonitor().isMonitoring()){
+                
if(!engine.getMonitor().hasCurrentExecutionTerminatedNotificationReceived() && 
engine.getMonitor().isMonitoring()){
                     if (JOptionPane.showConfirmDialog(null,
                             "A previous workflow execution data needs to be 
cleared before launching another workflow. Do you wish to continue?",
-                            "Run Workflow", 
JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
-                        //TODO: add clean up workflow interpretter - 
AIRAVATA-609
-//                        cleanup();
-                    }else{
+                            "Run Workflow", 
JOptionPane.YES_NO_OPTION)!=JOptionPane.YES_OPTION){
                         return;
                     }
                 }


Reply via email to