airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: fixing AIRAVATA-1409
Date Wed, 20 Aug 2014 17:59:39 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 6305d3a51 -> aa4cd2cb6


fixing AIRAVATA-1409


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

Branch: refs/heads/master
Commit: aa4cd2cb655a59e5e76d4fcc3da108c092be9a20
Parents: 6305d3a
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Aug 20 13:59:32 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Aug 20 13:59:32 2014 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  |  6 +++---
 .../registry/jpa/impl/ExperimentRegistry.java   | 21 ++++++++++++++++++++
 .../jpa/resources/ErrorDetailResource.java      |  8 +++++++-
 3 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/aa4cd2cb/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 52a04e9..8cfe59b 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -65,7 +65,7 @@ public class CreateLaunchExperiment {
     private static String localHostAppId = "localhost_3b5962d3-5e7e-4a97-9d1f-25c5ec436ba5,SimpleEcho0_44c34394-ca27-4fa9-bb2d-87f95a02352a";
     private static String sshHostAppId;
     private static String pbsEchoAppId = "trestles.sdsc.edu_03b34af0-f55d-4cb3-9bce-abba35d8b30d,SimpleEcho2_e8ca0bb2-d985-4775-884b-a27b29a33251";
-    private static String pbsWRFAppId = "trestles.sdsc.edu_66caf560-497d-4316-b1e9-adadc5817b20,WRF_61490c54-dacf-4bc4-874c-ad5909a65afb";
+    private static String pbsWRFAppId = "trestles.sdsc.edu_42adfdf7-d7bc-474a-8905-6624817b22ef,WRF_24f50b3c-4f1e-4358-bb10-c6838b12e231";
     private static String slurmAppId = "stampede.tacc.xsede.org_b2ef59cb-f626-4767-9ca0-601f94c42ba4,SimpleEcho3_b81c2559-a088-42a3-84ce-40119d874918";
     private static String sgeAppId;
     private static String br2EchoAppId = "bigred2_9c1e6be8-f7d8-4494-98f2-bf508790e8c6,SimpleEchoBR_149fd613-98e2-46e7-ac7c-4d393349469e";
@@ -85,11 +85,11 @@ public class CreateLaunchExperiment {
 //            addDescriptors();
 
 ////            final String expId = createExperimentForSSHHost(airavata);
-            final String expId = createExperimentForTrestles(client);
+//            final String expId = createExperimentForTrestles(client);
 ////            final String expId = createExperimentForStampede(client);
 //            final String expId = createExperimentForLocalHost(client);
 //            final String expId = createExperimentForLonestar(airavata);
-//            final String expId = createExperimentWRFTrestles(client);
+            final String expId = createExperimentWRFTrestles(client);
 //            final String expId = createExperimentForBR2(client);
 //            final String expId = createExperimentForBR2Amber(client);
 //            final String expId = createExperimentWRFStampede(client);

http://git-wip-us.apache.org/repos/asf/airavata/blob/aa4cd2cb/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 0c54183..1d0a4a2 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -33,6 +33,7 @@ import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.airavata.registry.cpi.utils.StatusType;
+import org.apache.airavata.schemas.gfac.IntegerArrayType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1336,6 +1337,16 @@ public class ExperimentRegistry {
                     workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
                     taskDetail = workflowNode.getTaskDetail((String) id);
                     errorResource = (ErrorDetailResource) taskDetail.create(ResourceType.ERROR_DETAIL);
+                    if (error.getErrorID() != null){
+                        List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
+                        if (errorDetailList != null && !errorDetailList.isEmpty()){
+                            for (ErrorDetailResource errorDetailResource : errorDetailList){
+                                if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorID())){
+                                    errorResource = errorDetailResource;
+                                }
+                            }
+                        }
+                    }
                     errorResource.setTaskDetailResource(taskDetail);
                     errorResource.setNodeDetail(taskDetail.getWorkflowNodeDetailResource());
                     errorResource.setExperimentResource(taskDetail.getWorkflowNodeDetailResource().getExperimentResource());
@@ -1350,6 +1361,16 @@ public class ExperimentRegistry {
                     taskDetail = workflowNode.getTaskDetail((String) cid.getTopLevelIdentifier());
                     JobDetailResource jobDetail = taskDetail.getJobDetail((String) cid.getSecondLevelIdentifier());
                     errorResource = (ErrorDetailResource) jobDetail.create(ResourceType.ERROR_DETAIL);
+                    if (error.getErrorID() != null){
+                        List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
+                        if (errorDetailList != null && !errorDetailList.isEmpty()){
+                            for (ErrorDetailResource errorDetailResource : errorDetailList){
+                                if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorID())){
+                                       errorResource = errorDetailResource;
+                                }
+                            }
+                        }
+                    }
                     errorResource.setTaskDetailResource(taskDetail);
                     errorResource.setNodeDetail(taskDetail.getWorkflowNodeDetailResource());
                     errorResource.setExperimentResource(taskDetail.getWorkflowNodeDetailResource().getExperimentResource());

http://git-wip-us.apache.org/repos/asf/airavata/blob/aa4cd2cb/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ErrorDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ErrorDetailResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ErrorDetailResource.java
index ec2493d..95804bd 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ErrorDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ErrorDetailResource.java
@@ -177,7 +177,13 @@ public class ErrorDetailResource extends AbstractResource {
         try {
             em = ResourceUtils.getEntityManager();
             em.getTransaction().begin();
-            ErrorDetail errorDetail = new ErrorDetail();
+            ErrorDetail errorDetail;
+            if (errorId != 0) {
+                errorDetail = em.find(ErrorDetail.class, errorId);
+                errorDetail.setErrorID(errorId);
+            } else {
+                errorDetail = new ErrorDetail();
+            }
             errorDetail.setErrorID(errorId);
             Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
             errorDetail.setExperiment(experiment);


Mime
View raw message