This is an automated email from the ASF dual-hosted git repository.

yasith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 84ce9be1666ffd524b7a472b3de031ed23363d5e
Author: yasithdev <[email protected]>
AuthorDate: Mon Jul 14 09:03:16 2025 -0500

    use current timestsamp when saving process statuses
---
 .../repositories/expcatalog/ProcessRepository.java |  2 ++
 .../repositories/expcatalog/TaskRepository.java    | 11 +++++--
 .../registry/core/utils/ObjectMapperSingleton.java | 36 +++++++++++-----------
 3 files changed, 29 insertions(+), 20 deletions(-)

diff --git 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProcessRepository.java
 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProcessRepository.java
index 0f7316f2ee..497491fe44 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProcessRepository.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProcessRepository.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.model.commons.airavata_commonsConstants;
 import org.apache.airavata.model.process.ProcessModel;
 import 
org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
@@ -120,6 +121,7 @@ public class ProcessRepository extends 
ExpCatAbstractRepository<ProcessModel, Pr
             logger.debug("Populating the Primary Key of Task objects for the 
Process");
             processEntity.getTasks().forEach(taskEntity -> {
                 taskEntity.setParentProcessId(processId);
+                
taskEntity.setCreationTime(AiravataUtils.getCurrentTimestamp());
                 taskRepository.populateParentIds(taskEntity);
             });
         }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/TaskRepository.java
 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/TaskRepository.java
index 5facb7e1d8..1a3f9af601 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/TaskRepository.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/TaskRepository.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.model.commons.airavata_commonsConstants;
 import org.apache.airavata.model.task.TaskModel;
 import org.apache.airavata.registry.core.entities.expcatalog.TaskEntity;
@@ -87,12 +88,18 @@ public class TaskRepository extends 
ExpCatAbstractRepository<TaskModel, TaskEnti
 
         if (taskEntity.getTaskStatuses() != null) {
             logger.debug("Populating the Primary Key of TaskStatus objects for 
the Task");
-            taskEntity.getTaskStatuses().forEach(taskStatusEntity -> 
taskStatusEntity.setTaskId(taskId));
+            taskEntity.getTaskStatuses().forEach(taskStatusEntity -> {
+                taskStatusEntity.setTaskId(taskId);
+                
taskStatusEntity.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp());
+            });
         }
 
         if (taskEntity.getTaskErrors() != null) {
             logger.debug("Populating the Primary Key of TaskError objects for 
the Task");
-            taskEntity.getTaskErrors().forEach(taskErrorEntity -> 
taskErrorEntity.setTaskId(taskId));
+            taskEntity.getTaskErrors().forEach(taskErrorEntity -> {
+                taskErrorEntity.setTaskId(taskId);
+                
taskErrorEntity.setCreationTime(AiravataUtils.getCurrentTimestamp());
+            });
         }
 
         if (taskEntity.getJobs() != null) {
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
index d53995c50b..452f5a555d 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java
@@ -1,22 +1,22 @@
 /**
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
 package org.apache.airavata.registry.core.utils;
 
 import com.github.dozermapper.core.DozerBeanMapperBuilder;

Reply via email to