zhuangchong commented on a change in pull request #8036:
URL: https://github.com/apache/dolphinscheduler/pull/8036#discussion_r785647295
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -1131,6 +1135,19 @@ private boolean checkAndImport(User loginUser, long
projectCode, Map<String, Obj
}
taskDefinitionLogList.add(taskDefinitionLog);
}
+ //fix taskParams when taskType is SWITCH
+ for (TaskDefinitionLog taskDefinitionLog: taskDefinitionLogList) {
+ if
(TaskType.SWITCH.getDesc().equals(taskDefinitionLog.getTaskType())) {
+ String taskParams = taskDefinitionLog.getTaskParams();
+ Matcher matcher = SWITCH_NODE_REGEX.matcher(taskParams);
+ while (matcher.find()) {
+ String oldTaskCode = matcher.group(1).trim();
+ Long newTaskCode =
taskCodeMap.get(Long.parseLong(oldTaskCode));
+ taskParams = taskParams.replaceAll(oldTaskCode,
newTaskCode == null ? oldTaskCode : newTaskCode.toString());
+ }
+ taskDefinitionLog.setTaskParams(taskParams);
Review comment:
This code should be moved into the section above lines 1117-1137 dealing
with taskDefinitionList
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]