Browse Source

[Fix-7019][MasterServer] Fix the issue with failing to save and run the process that contains the switch task. (#7046)

3.0.0/version-upgrade
Hua Jiang 3 years ago committed by GitHub
parent
commit
a0955a078a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java
  2. 2
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
  3. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java

4
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/switchtask/SwitchResultVo.java

@ -42,6 +42,10 @@ public class SwitchResultVo {
List<String> nextNodeList = new ArrayList<>();
nextNodeList.add(String.valueOf(nextNode));
this.nextNode = nextNodeList;
} else if (nextNode instanceof Number) {
List<String> nextNodeList = new ArrayList<>();
nextNodeList.add(nextNode.toString());
this.nextNode = nextNodeList;
} else {
this.nextNode = (ArrayList) nextNode;
}

2
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java

@ -406,7 +406,7 @@ public class DagHelper {
Map<String, TaskInstance> completeTaskList,
DAG<String, TaskNode, TaskNodeRelation> dag) {
SwitchParameters switchParameters = completeTaskList.get(taskNode.getName()).getSwitchDependency();
SwitchParameters switchParameters = completeTaskList.get(Long.toString(taskNode.getCode())).getSwitchDependency();
int resultConditionLocation = switchParameters.getResultConditionLocation();
List<SwitchResultVo> conditionResultVoList = switchParameters.getDependTaskList();
List<String> switchTaskList = conditionResultVoList.get(resultConditionLocation).getNextNode();

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/task/SwitchTaskProcessor.java

@ -210,7 +210,7 @@ public class SwitchTaskProcessor extends BaseTaskProcessor {
if (!org.apache.commons.lang.math.NumberUtils.isNumber(value)) {
value = "\"" + value + "\"";
}
logger.info("paramName:{},paramValue{}", paramName, value);
logger.info("paramName:{},paramValue:{}", paramName, value);
content = content.replace("${" + paramName + "}", value);
}
return content;

Loading…
Cancel
Save