You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2012/11/30 17:49:19 UTC

svn commit: r1415736 - /airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java

Author: chathuri
Date: Fri Nov 30 16:49:18 2012
New Revision: 1415736

URL: http://svn.apache.org/viewvc?rev=1415736&view=rev
Log:
updating airavata 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=1415736&r1=1415735&r2=1415736&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 16:49:18 2012
@@ -407,6 +407,8 @@ public class AiravataClient extends Obse
 			String workflowInstanceName, WorkflowContextHeaderBuilder builder) throws AiravataConfigurationException {
 		String worflowoutput = null;
 		try {
+            builder.setUserIdentifier(getCurrentUser());
+            System.out.println("**********CURRENT USER **************" + getCurrentUser());
 			WorkflowInterpretorStub stub = new WorkflowInterpretorStub(
 					getClientConfiguration().getXbayaServiceURL().toString());
 			OMElement omElement = AXIOMUtil.stringToOM(XMLUtil
@@ -500,6 +502,8 @@ public class AiravataClient extends Obse
 
         //TODO - fix user passing
         builder.setUserIdentifier(getCurrentUser());
+        System.out.println("**********CURRENT USER1 **************" + getCurrentUser());
+
 		try {
 			runPreWorkflowExecutionTasks(topic, user, metadata, experimentName);
 		} catch (RegistryException e) {
@@ -716,8 +720,18 @@ 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 {
-			Workflow workflowObj = getWorkflow(workflowName);
+            if(getWorkflowManager().isWorkflowExists(workflow)) {
+                workflowObj = getWorkflow(workflowName);
+            }else {
+                try{
+                    workflowObj = getWorkflowManager().getWorkflowFromString(workflowName);
+                }catch (AiravataAPIInvocationException e){
+                    getWorkflowManager().getWorkflow(workflowName);
+                }
+
+            }
 			String workflowString = XMLUtil.xmlElementToString(workflowObj
                     .toXML());
 			List<WSComponentPort> ports;