cloning experiment issue

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/1e8331fd
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/1e8331fd
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/1e8331fd

Branch: refs/heads/workflow-support
Commit: 1e8331fd629412e982a840b7df728182a929dc17
Parents: d89835b
Author: Chathuri Wimalasena <[email protected]>
Authored: Sat Jul 12 17:39:21 2014 -0400
Committer: Chathuri Wimalasena <[email protected]>
Committed: Sat Jul 12 17:39:21 2014 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java   | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/1e8331fd/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index ae5e995..873c4f2 100644
--- 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -46,6 +46,7 @@ import 
org.apache.aiaravata.application.catalog.data.util.AppCatalogThriftConver
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.airavataAPIConstants;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import 
org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
@@ -1139,9 +1140,16 @@ public class AiravataServerHandler implements 
Airavata.Iface, Watcher {
                 throw new ExperimentNotFoundException("Requested experiment id 
" + existingExperimentID + " does not exist in the system..");
             }
             Experiment existingExperiment = 
(Experiment)registry.get(RegistryModelType.EXPERIMENT, existingExperimentID);
+            
existingExperiment.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
             if (validateString(newExperiementName)){
                 existingExperiment.setName(newExperiementName);
             }
+            if (existingExperiment.getWorkflowNodeDetailsList() != null){
+                existingExperiment.getWorkflowNodeDetailsList().clear();
+            }
+            if (existingExperiment.getErrors() != null ){
+                existingExperiment.getErrors().clear();
+            }
             return (String)registry.add(ParentDataType.EXPERIMENT, 
existingExperiment);
         } catch (Exception e) {
             logger.error("Error while cloning the experiment with existing 
configuration...", e);

Reply via email to