This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new c56daed [Fix-6352] [ApiServer] fix process definition copy bug (#6357)
c56daed is described below
commit c56daede2f9812e88b2ea4a5f5ab4436782b171c
Author: JinYong Li <[email protected]>
AuthorDate: Sun Sep 26 16:36:54 2021 +0800
[Fix-6352] [ApiServer] fix process definition copy bug (#6357)
* fix 6320 batch delete process definition bug
* fix-6352 process definition copy bug
Co-authored-by: JinyLeeChina <[email protected]>
---
.../api/service/impl/ProcessDefinitionServiceImpl.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
index 1812197..ba467f0 100644
---
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
+++
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
@@ -1335,6 +1335,14 @@ public class ProcessDefinitionServiceImpl extends
BaseServiceImpl implements Pro
List<ProcessTaskRelationLog> taskRelationList =
processTaskRelations.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList());
processDefinition.setProjectCode(targetProjectCode);
if (isCopy) {
+ try {
+
processDefinition.setCode(SnowFlakeUtils.getInstance().nextId());
+ } catch (SnowFlakeException e) {
+ putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS);
+ throw new
ServiceException(Status.INTERNAL_SERVER_ERROR_ARGS);
+ }
+ processDefinition.setId(0);
+ processDefinition.setUserId(loginUser.getId());
processDefinition.setName(processDefinition.getName() +
"_copy_" + DateUtils.getCurrentTimeStamp());
try {
result.putAll(createDagDefine(loginUser, taskRelationList,
processDefinition, Lists.newArrayList()));