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 2020/11/27 22:12:33 UTC

[airavata] 01/01: Fixing AIRAVATA-3391 : Resolving parameters in the groovy map data

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

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

commit 79efb906036de33e168c97aa9740171c131df336
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri Nov 27 17:12:18 2020 -0500

    Fixing AIRAVATA-3391 : Resolving parameters in the groovy map data
---
 .../airavata/helix/impl/task/submission/config/GroovyMapData.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
index 316a34f..cc1d5e1 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/config/GroovyMapData.java
@@ -531,6 +531,8 @@ public class GroovyMapData {
         Writable make;
         try {
             make = engine.createTemplate(templateStr).make(toImmutableMap());
+            String intermediateOut = make.toString();
+            make = engine.createTemplate(intermediateOut).make(toImmutableMap()); // Parsing through the map to resolve parameters in the map values (AIRAVATA-3391)
         } catch (Exception e) {
             throw new Exception("Error while generating script using groovy map for string " + templateStr, e);
         }
@@ -552,8 +554,9 @@ public class GroovyMapData {
         TemplateEngine engine = new GStringTemplateEngine();
         Writable make;
         try {
-
             make = engine.createTemplate(templateUrl).make(toImmutableMap());
+            String intermediateOut = make.toString();
+            make = engine.createTemplate(intermediateOut).make(toImmutableMap()); // Parsing through the map to resolve parameters in the map values (AIRAVATA-3391)
         } catch (Exception e) {
             throw new Exception("Error while generating script using groovy map for template " + templateUrl.getPath(), e);
         }