You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2013/10/23 20:17:51 UTC
svn commit: r1535090 - in
/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya:
interpretor/WorkflowInterpreter.java jython/lib/NotificationSender.java
ui/monitor/MonitorEventHandler.java
Author: lahiru
Date: Wed Oct 23 18:17:50 2013
New Revision: 1535090
URL: http://svn.apache.org/r1535090
Log:
fixing issue https://issues.apache.org/jira/browse/AIRAVATA-939.
Modified:
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1535090&r1=1535089&r2=1535090&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java Wed Oct 23 18:17:50 2013
@@ -302,8 +302,10 @@ public class WorkflowInterpreter {
}
}
}
- this.config.getNotifier().workflowTerminated();
- UUID uuid = UUID.randomUUID();
+
+ this.config.getNotifier().workflowTerminated();
+
+ UUID uuid = UUID.randomUUID();
notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_START, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow",
"Cleaning up resources for Workflow", uuid.toString()));
// Send Notification for output values
Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java?rev=1535090&r1=1535089&r2=1535090&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java Wed Oct 23 18:17:50 2013
@@ -203,7 +203,7 @@ public class NotificationSender implemen
message += keywords[i] + "=" + args[i];
}
this.notifier.sendingResult(context, this.invocationContext, message);
- this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+ this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
}
/*
@@ -213,7 +213,7 @@ public class NotificationSender implemen
*/
@Override
public void workflowTerminated() {
- this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+ this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
}
/*
Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java?rev=1535090&r1=1535089&r2=1535090&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java Wed Oct 23 18:17:50 2013
@@ -83,9 +83,9 @@ public class MonitorEventHandler impleme
FAILED(Color.RED),
/**
- * DEFAULT COLOR
- */
- DEFAULT(NodeGUI.DEFAULT_BODY_COLOR);
+ * DEFAULT COLOR
+ */
+ DEFAULT(NodeGUI.DEFAULT_BODY_COLOR);
/**
@@ -116,10 +116,11 @@ public class MonitorEventHandler impleme
/**
* Model MonitorEventHandler
+ *
* @param xbayaGUI
*/
public MonitorEventHandler(XBayaGUI xbayaGUI) {
- this.xbayaGUI=xbayaGUI;
+ this.xbayaGUI = xbayaGUI;
this.incorrectWorkflowIDs = Collections.synchronizedSet(new HashSet<URI>());
this.triedWorkflowIDs = Collections.synchronizedSet(new HashSet<URI>());
this.resourcePaintableMap = new HashMap<Node, LinkedList<ResourcePaintable>>();
@@ -194,11 +195,11 @@ public class MonitorEventHandler impleme
Workflow workflow = graphCanvas.getWorkflow();
// URI instanceID = workflow.getGPELInstanceID();
// if (instanceID == null) {
- // If the workflow doesn't have an instance ID, it's a template.
- // We handle it so that users can use a workflow template to
- // monitor a workflow too.
- // This is also needed in the case of jython workflow.
- handleEvent(event, forward, workflow.getGraph());
+ // If the workflow doesn't have an instance ID, it's a template.
+ // We handle it so that users can use a workflow template to
+ // monitor a workflow too.
+ // This is also needed in the case of jython workflow.
+ handleEvent(event, forward, workflow.getGraph());
// } else if (instanceID.equals(workflowID)) {
// This is the regular case.
// found = true;
@@ -305,7 +306,8 @@ public class MonitorEventHandler impleme
EventType type = event.getType();
String nodeID = event.getNodeID();
Node node = graph.getNode(nodeID);
- System.out.println(type);;
+ System.out.println(type);
+ ;
// logger.info("type: " + type);
if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
workflowStarted(graph, forward);
@@ -314,8 +316,8 @@ public class MonitorEventHandler impleme
workflowFinished(graph, forward);
// workflowStatusUpdater.workflowFinished(event.getExperimentID());
} else if (type == EventType.INVOKING_SERVICE
- // TODO this should be removed when GPEL sends all notification
- // correctly.
+ // TODO this should be removed when GPEL sends all notification
+ // correctly.
|| type == EventType.SERVICE_INVOKED) {
if (node == null) {
logger.warn("There is no node that has ID, " + nodeID);
@@ -324,8 +326,8 @@ public class MonitorEventHandler impleme
// workflowNodeStatusUpdater.workflowStarted(event.getExperimentID(), event.getNodeID());
}
} else if (type == MonitorUtil.EventType.RECEIVED_RESULT
- // TODO this should be removed when GPEL sends all notification
- // correctly.
+ // TODO this should be removed when GPEL sends all notification
+ // correctly.
|| type == EventType.SENDING_RESULT) {
if (node == null) {
logger.warn("There is no node that has ID, " + nodeID);
@@ -335,7 +337,7 @@ public class MonitorEventHandler impleme
}
} else if (type == EventType.INVOKING_SERVICE_FAILED || type == EventType.RECEIVED_FAULT
- // TODO
+ // TODO
|| type == EventType.SENDING_FAULT || type == EventType.SENDING_RESPONSE_FAILED) {
if (node == null) {
logger.warn("There is no node that has ID, " + nodeID);
@@ -423,7 +425,7 @@ public class MonitorEventHandler impleme
private void nodeStarted(Node node, boolean forward) {
if (forward) {
- if (node.getState()!= NodeExecutionState.FINISHED) {
+ if (node.getState() != NodeExecutionState.FINISHED) {
executeNode(node);
finishPredecessorNodes(node);
}
@@ -502,7 +504,9 @@ public class MonitorEventHandler impleme
}
private void finishNode(Node node) {
- node.setState(NodeExecutionState.FINISHED);
+ if (!NodeExecutionState.FAILED.equals(node.getState())) {
+ node.setState(NodeExecutionState.FINISHED);
+ }
}
private void failNode(Node node) {