airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1480423 - in /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: interpretor/WorkflowInterpretorEventListener.java provenance/WorkflowNodeStatusUpdater.java
Date Wed, 08 May 2013 19:47:20 GMT
Author: lahiru
Date: Wed May  8 19:47:20 2013
New Revision: 1480423

URL: http://svn.apache.org/r1480423
Log:
Storing more fine grained job specific data.

Modified:
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java?rev=1480423&r1=1480422&r2=1480423&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
Wed May  8 19:47:20 2013
@@ -187,8 +187,8 @@ public class WorkflowInterpretorEventLis
 				}
             } else {
                 nodeStarted(node, forward);
-                workflowNodeStatusUpdater.workflowStarted(event.getExperimentID(), event.getNodeID()
-                        ,event.getMessage(),event.getWorkflowID().toASCIIString());
+                workflowNodeStatusUpdater.workflowNodeStarted(event.getExperimentID(), event.getNodeID()
+                        , event.getMessage(), event.getWorkflowID().toASCIIString());
             }
         } else if (type == MonitorUtil.EventType.RECEIVED_RESULT
         // TODO this should be removed when GPEL sends all notification
@@ -200,7 +200,7 @@ public class WorkflowInterpretorEventLis
 				}
         	} else {
                 nodeFinished(node, forward);
-                workflowNodeStatusUpdater.workflowFinished(event.getExperimentID(), event.getNodeID(),
event.getMessage(),
+                workflowNodeStatusUpdater.workflowNodeFinished(event.getExperimentID(), event.getNodeID(),
event.getMessage(),
                         event.getWorkflowID().toASCIIString());
             }
         } else if (type == EventType.RECEIVED_FAULT
@@ -211,7 +211,7 @@ public class WorkflowInterpretorEventLis
 				}
             } else {
                 nodeFailed(node, forward);
-                workflowNodeStatusUpdater.workflowFailed(event.getExperimentID(), event.getNodeID());
+                workflowNodeStatusUpdater.workflowNodeFailed(event.getExperimentID(), event.getNodeID());
             }
             try {
                 this.unsubscribe();
@@ -225,7 +225,17 @@ public class WorkflowInterpretorEventLis
 				}
             } else {
                 // nodeResourceMapped(node, event.getEvent(), forward);
-                workflowNodeStatusUpdater.workflowRunning(event.getExperimentID(), event.getNodeID());
+                workflowNodeStatusUpdater.workflowNodeRunning(event.getExperimentID(), event.getNodeID());
+            }
+        } else if(type == MonitorUtil.EventType.LOG_INFO){
+            // This is not very gram specific, if these data is required in other provider
they have to send
+            // the notification in info mode with ending these text, DONE,PENDING and ACTIVE
+            if(event.getMessage().endsWith("DONE")) {
+                workflowNodeStatusUpdater.workflowNodeStatusDone(event.getExperimentID(),
event.getNodeID());
+            } else if(event.getMessage().endsWith("PENDING")){
+                workflowNodeStatusUpdater.workflowNodeStatusPending(event.getExperimentID(),
event.getNodeID());
+            } else if(event.getMessage().endsWith("ACTIVE")){
+                workflowNodeStatusUpdater.workflowNodeStatusActive(event.getExperimentID(),
event.getNodeID());
             }
         } else {
             // Ignore the rest.

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java?rev=1480423&r1=1480422&r2=1480423&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
Wed May  8 19:47:20 2013
@@ -39,7 +39,7 @@ public class WorkflowNodeStatusUpdater {
         this.airavataAPI = airavataAPI;
     }
 
-    public boolean workflowStarted(String workflowInstanceID,String nodeID,String inputs,String
workflowID){
+    public boolean workflowNodeStarted(String workflowInstanceID,String nodeID,String inputs,String
workflowID){
         try {
             //todo we currently save only service nodes
             WorkflowNodeType workflowNodeType = new WorkflowNodeType();
@@ -55,7 +55,7 @@ public class WorkflowNodeStatusUpdater {
         return true;
     }
 
-    public boolean workflowFailed(String workflowInstanceID,String nodeID){
+    public boolean workflowNodeFailed(String workflowInstanceID,String nodeID){
         try {
             airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FAILED);
             airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(workflowInstanceID,
workflowInstanceID, WorkflowExecutionStatus.State.FAILED);
@@ -66,7 +66,7 @@ public class WorkflowNodeStatusUpdater {
         return true;
     }
 
-    public boolean workflowFinished(String workflowInstanceID,String nodeID,String inputs,String
workflowID){
+    public boolean workflowNodeFinished(String workflowInstanceID,String nodeID,String inputs,String
workflowID){
         try {
         	WorkflowNodeType workflowNodeType = new WorkflowNodeType();
             workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
@@ -81,7 +81,7 @@ public class WorkflowNodeStatusUpdater {
         return true;
     }
 
-    public boolean workflowRunning(String workflowInstanceID,String nodeID){
+    public boolean workflowNodeRunning(String workflowInstanceID,String nodeID){
         try {
             airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.RUNNING);
         } catch (AiravataAPIInvocationException e) {
@@ -91,7 +91,7 @@ public class WorkflowNodeStatusUpdater {
         return true;
     }
 
-     public boolean workflowPaused(String workflowInstanceID,String nodeID){
+     public boolean workflowNodePaused(String workflowInstanceID,String nodeID){
         try {
             airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PAUSED);
         } catch (AiravataAPIInvocationException e) {
@@ -100,4 +100,36 @@ public class WorkflowNodeStatusUpdater {
         }
         return true;
     }
+
+    public boolean workflowNodeStatusPending(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PENDING);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+       public boolean workflowNodeStatusActive(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.ACTIVE);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+       public boolean workflowNodeStatusDone(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID,
workflowInstanceID, nodeID, WorkflowExecutionStatus.State.DONE);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+
 }



Mime
View raw message