airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1415744 - /airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
Date Fri, 30 Nov 2012 17:10:39 GMT
Author: chathuri
Date: Fri Nov 30 17:10:38 2012
New Revision: 1415744

URL: http://svn.apache.org/viewvc?rev=1415744&view=rev
Log:
updating client

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java?rev=1415744&r1=1415743&r2=1415744&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
Fri Nov 30 17:10:38 2012
@@ -658,7 +658,7 @@ public class AiravataClient extends Obse
 			List<WorkflowInput> inputs, String user, String metadata,
 			String workflowInstanceName, WorkflowContextHeaderBuilder builder)
 			throws Exception {
-		Workflow workflowObj = getWorkflow(workflowTemplateId);
+		Workflow workflowObj = extractWorkflow(workflowTemplateId);
 		return runWorkflow(workflowObj, inputs, user, metadata,
 				workflowInstanceName, builder);
 	}
@@ -720,18 +720,8 @@ public class AiravataClient extends Obse
 	public String runWorkflow(String workflowName, List<WorkflowInput> inputs,
 			String user, String metadata, String workflowInstanceName,
 			String experimentID) throws AiravataAPIInvocationException {
-        Workflow workflowObj = null;
 		try {
-            if(getWorkflowManager().isWorkflowExists(workflow)) {
-                workflowObj = getWorkflow(workflowName);
-            }else {
-                try{
-                    workflowObj = getWorkflowManager().getWorkflowFromString(workflowName);
-                }catch (AiravataAPIInvocationException e){
-                    getWorkflowManager().getWorkflow(workflowName);
-                }
-
-            }
+            Workflow workflowObj = extractWorkflow(workflowName);
 			String workflowString = XMLUtil.xmlElementToString(workflowObj
                     .toXML());
 			List<WSComponentPort> ports;
@@ -774,7 +764,22 @@ public class AiravataClient extends Obse
         }
 	}
 
-	public List<WorkflowInput> getWorkflowInputs(String workflowTemplateId)
+    private Workflow extractWorkflow(String workflowName) throws AiravataAPIInvocationException
{
+        Workflow workflowObj = null;
+        if(getWorkflowManager().isWorkflowExists(workflow)) {
+            workflowObj = getWorkflow(workflowName);
+        }else {
+            try{
+                workflowObj = getWorkflowManager().getWorkflowFromString(workflowName);
+            }catch (AiravataAPIInvocationException e){
+                getWorkflowManager().getWorkflow(workflowName);
+            }
+
+        }
+        return workflowObj;
+    }
+
+    public List<WorkflowInput> getWorkflowInputs(String workflowTemplateId)
 			throws AiravataAPIInvocationException {
 		try {
 			Workflow workflowTemplate = getWorkflow(workflowTemplateId);



Mime
View raw message