From 36f01155b5c528cd7551c0d79662ba62b3de1677 Mon Sep 17 00:00:00 2001 From: exmy Date: Fri, 22 Apr 2022 14:10:21 +0800 Subject: [PATCH] [Improvement][server] varPool support syntax #{setValue(key=value)} (#9586) --- .../plugin/task/api/AbstractCommandExecutor.java | 2 +- .../apache/dolphinscheduler/plugin/task/api/TaskConstants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java index 340053844a..e5e85a4332 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/AbstractCommandExecutor.java @@ -318,7 +318,7 @@ public abstract class AbstractCommandExecutor { try (BufferedReader inReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { String line; while ((line = inReader.readLine()) != null) { - if (line.startsWith("${setValue(")) { + if (line.startsWith("${setValue(") || line.startsWith("#{setValue(")) { varPool.append(findVarPool(line)); varPool.append("$VarPool$"); } else { diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/TaskConstants.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/TaskConstants.java index 209be57e71..bb00b6257b 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/TaskConstants.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/TaskConstants.java @@ -28,7 +28,7 @@ public class TaskConstants { public static final String APPLICATION_REGEX = "application_\\d+_\\d+"; - public static final String SETVALUE_REGEX = "\\$\\{setValue\\(([^)]*)\\)}"; + public static final String SETVALUE_REGEX = "[\\$#]\\{setValue\\(([^)]*)\\)}"; /** * string false