You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2015/03/19 20:11:57 UTC
[39/50] [abbrv] airavata git commit: Fixed new workflow interpreter
termination issue.
Fixed new workflow interpreter termination issue.
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/97004593
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/97004593
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/97004593
Branch: refs/heads/new-workflow-design
Commit: 970045939852e228bd7059eac8c7df30acad0c0e
Parents: ad8e482
Author: shamrath <sh...@gmail.com>
Authored: Fri Mar 13 14:40:32 2015 -0400
Committer: shamrath <sh...@gmail.com>
Committed: Fri Mar 13 14:40:32 2015 -0400
----------------------------------------------------------------------
.../workflow/engine/SimpleWorkflowInterpreter.java | 15 ++++++++++++++-
.../workflow/engine/dag/port/InputPortIml.java | 3 ++-
2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/97004593/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/SimpleWorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/SimpleWorkflowInterpreter.java b/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/SimpleWorkflowInterpreter.java
index ee7ff6b..5504f84 100644
--- a/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/SimpleWorkflowInterpreter.java
+++ b/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/SimpleWorkflowInterpreter.java
@@ -115,6 +115,16 @@ class SimpleWorkflowInterpreter{
log.debug("Parsed the workflow and got the workflow input nodes");
// process workflow input nodes
processWorkflowInputNodes(getWorkflowInputNodes());
+ if (readyList.isEmpty()) {
+ StringBuilder sb = new StringBuilder();
+ for (WorkflowInputNode workflowInputNode : workflowInputNodes) {
+ sb.append(", ");
+ sb.append(workflowInputNode.getInputObject().getName());
+ sb.append("=");
+ sb.append(workflowInputNode.getInputObject().getValue());
+ }
+ throw new AiravataException("No workflow application node in ready state to run with experiment inputs" + sb.toString());
+ }
processReadyList();
}
@@ -125,6 +135,9 @@ class SimpleWorkflowInterpreter{
* @throws AiravataException
*/
void processReadyList() throws RegistryException, AiravataException {
+ if (readyList.isEmpty() && processingQueue.isEmpty() && !waitingList.isEmpty()) {
+ throw new AiravataException("No workflow application node in ready state to run");
+ }
for (WorkflowNode readyNode : readyList.values()) {
if (readyNode instanceof WorkflowOutputNode) {
WorkflowOutputNode wfOutputNode = (WorkflowOutputNode) readyNode;
@@ -272,7 +285,7 @@ class SimpleWorkflowInterpreter{
}
boolean isAllDone() {
- return !continueWorkflow || (waitingList.isEmpty() && readyList.isEmpty());
+ return !continueWorkflow || (waitingList.isEmpty() && readyList.isEmpty() && processingQueue.isEmpty());
}
private void setExperiment(String experimentId) throws RegistryException {
http://git-wip-us.apache.org/repos/asf/airavata/blob/97004593/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/dag/port/InputPortIml.java
----------------------------------------------------------------------
diff --git a/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/dag/port/InputPortIml.java b/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/dag/port/InputPortIml.java
index c78dc86..076f5b6 100644
--- a/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/dag/port/InputPortIml.java
+++ b/modules/simple-workflow/src/main/java/org/apache/airavata/simple/workflow/engine/dag/port/InputPortIml.java
@@ -69,7 +69,8 @@ public class InputPortIml implements InPort {
@Override
public boolean isReady() {
- return getInputObject() != null && inputDataObjectType.getValue() != null && !inputDataObjectType.getValue().equals("");
+ return getInputObject() != null && (!inputDataObjectType.isIsRequired() ||
+ (inputDataObjectType.getValue() != null && !inputDataObjectType.getValue().equals("")));
}
@Override