airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1235878 - /incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Date Wed, 25 Jan 2012 19:11:34 GMT
Author: samindaw
Date: Wed Jan 25 19:11:33 2012
New Revision: 1235878

URL: http://svn.apache.org/viewvc?rev=1235878&view=rev
Log:
check property exist user, status, time for workflow execution

Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1235878&r1=1235877&r2=1235878&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Wed Jan 25 19:11:33 2012
@@ -919,14 +919,22 @@ public class AiravataJCRRegistry extends
         try {
             session = getSession();
             Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
-            ExecutionStatus status = ExecutionStatus.valueOf(workflowDataNode.getProperty(WORKFLOW_STATUS_PROPERTY).getString());
-            Property prop = workflowDataNode.getProperty(WORKFLOW_STATUS_TIME_PROPERTY);
-			Date date=null;
-			if (prop!=null) {
-				Long dateMiliseconds = prop.getLong();
-				Calendar cal = Calendar.getInstance();
-				cal.setTimeInMillis(dateMiliseconds);
-				date = cal.getTime();
+            ExecutionStatus status = null;
+			if (workflowDataNode.hasProperty(WORKFLOW_STATUS_PROPERTY)) {
+				status = ExecutionStatus.valueOf(workflowDataNode.getProperty(
+						WORKFLOW_STATUS_PROPERTY).getString());
+			}
+            Date date = null;
+			if (workflowDataNode.hasProperty(WORKFLOW_STATUS_TIME_PROPERTY)) {
+				Property prop = workflowDataNode
+						.getProperty(WORKFLOW_STATUS_TIME_PROPERTY);
+				date = null;
+				if (prop != null) {
+					Long dateMiliseconds = prop.getLong();
+					Calendar cal = Calendar.getInstance();
+					cal.setTimeInMillis(dateMiliseconds);
+					date = cal.getTime();
+				}
 			}
 			property=new WorkflowExecutionStatus(status, date);
             session.save();
@@ -1115,8 +1123,11 @@ public class AiravataJCRRegistry extends
         try {
             session = getSession();
             Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
-            property = workflowDataNode.getProperty(WORKFLOW_USER_PROPERTY).getString();
-            session.save();
+            if (workflowDataNode.hasProperty(WORKFLOW_USER_PROPERTY)) {
+				property = workflowDataNode.getProperty(WORKFLOW_USER_PROPERTY)
+						.getString();
+			}
+			session.save();
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
@@ -1202,8 +1213,11 @@ public class AiravataJCRRegistry extends
         try {
             session = getSession();
             Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
-            property = workflowDataNode.getProperty(WORKFLOW_METADATA_PROPERTY).getString();
-            session.save();
+            if (workflowDataNode.hasProperty(WORKFLOW_METADATA_PROPERTY)) {
+				property = workflowDataNode.getProperty(
+						WORKFLOW_METADATA_PROPERTY).getString();
+			}
+			session.save();
         } catch (Exception e) {
             throw new RegistryException("Error while retrieving workflow metadata!!!", e);
         } finally {



Mime
View raw message