You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/05/21 16:34:42 UTC

[airavata] branch AIRAVATA-3464 created (now ab3c997)

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

dimuthuupe pushed a change to branch AIRAVATA-3464
in repository https://gitbox.apache.org/repos/asf/airavata.git.


      at ab3c997  Fixing AIRAVATA-3464. Setting a fixed length for experiment id

This branch includes the following new commits:

     new ab3c997  Fixing AIRAVATA-3464. Setting a fixed length for experiment id

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[airavata] 01/01: Fixing AIRAVATA-3464. Setting a fixed length for experiment id

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch AIRAVATA-3464
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit ab3c9972665547ed4d69be859625dad3b726171b
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri May 21 12:34:28 2021 -0400

    Fixing AIRAVATA-3464. Setting a fixed length for experiment id
---
 .../registry/core/repositories/expcatalog/ExperimentRepository.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
index a59056c..7e226e8 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
@@ -113,7 +113,9 @@ public class ExperimentRepository extends ExpCatAbstractRepository<ExperimentMod
         experimentStatus.setState(ExperimentState.CREATED);
         experimentStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
         experimentModel.addToExperimentStatus(experimentStatus);
-        experimentModel.setExperimentId(AiravataUtils.getId(experimentModel.getExperimentName()));
+        String expName = experimentModel.getExperimentName();
+        // This is to avoid overflow of experiment id size. Total experiment id length is <= 50 + UUID
+        experimentModel.setExperimentId(AiravataUtils.getId(expName.substring(0, Math.min(expName.length(), 50))));
 
         return saveExperimentModelData(experimentModel);
     }