github-advanced-security[bot] commented on code in PR #16288:
URL: 
https://github.com/apache/dolphinscheduler/pull/16288#discussion_r1668286230


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessLineageController.java:
##########
@@ -122,33 +123,37 @@
     @PostMapping(value = "/tasks/verify-delete")
     @ResponseStatus(HttpStatus.OK)
     @ApiException(TASK_WITH_DEPENDENT_ERROR)
-    public Result verifyTaskCanDelete(@Parameter(hidden = true) 
@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
-                                      @Parameter(name = "projectCode", 
description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
-                                      @RequestParam(value = 
"processDefinitionCode", required = true) long processDefinitionCode,
-                                      @RequestParam(value = "taskCode", 
required = true) long taskCode) {
-        Result result = new Result();
+    public Result<Map<String, Object>> verifyTaskCanDelete(@Parameter(hidden = 
true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,

Review Comment:
   ## Useless parameter
   
   The parameter 'loginUser' is never used.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4231)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessLineageController.java:
##########
@@ -122,33 +123,37 @@
     @PostMapping(value = "/tasks/verify-delete")
     @ResponseStatus(HttpStatus.OK)
     @ApiException(TASK_WITH_DEPENDENT_ERROR)
-    public Result verifyTaskCanDelete(@Parameter(hidden = true) 
@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
-                                      @Parameter(name = "projectCode", 
description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
-                                      @RequestParam(value = 
"processDefinitionCode", required = true) long processDefinitionCode,
-                                      @RequestParam(value = "taskCode", 
required = true) long taskCode) {
-        Result result = new Result();
+    public Result<Map<String, Object>> verifyTaskCanDelete(@Parameter(hidden = 
true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
+                                                           @Parameter(name = 
"projectCode", description = "PROJECT_CODE", required = true) @PathVariable 
long projectCode,
+                                                           @RequestParam(value 
= "processDefinitionCode", required = true) long processDefinitionCode,
+                                                           @RequestParam(value 
= "taskCode", required = true) long taskCode) {
+        Result<Map<String, Object>> result = new Result<>();
         Optional<String> taskDepMsg =
-                workFlowLineageService.taskDepOnTaskMsg(projectCode, 
processDefinitionCode, taskCode);
+                processLineageService.taskDependentMsg(projectCode, 
processDefinitionCode, taskCode);
         if (taskDepMsg.isPresent()) {
             throw new ServiceException(taskDepMsg.get());
         }
         putMsg(result, Status.SUCCESS);
         return result;
     }
 
-    @Operation(summary = "queryDownstreamDependentTaskList", description = 
"QUERY_DOWNSTREAM_DEPENDENT_TASK_NOTES")
+    /**
+     * Whether task can be deleted or not, avoiding task depend on other task 
of process definition delete by accident.
+     */
+    @Operation(summary = "verifyTaskCanDelete", description = 
"VERIFY_TASK_CAN_DELETE")
     @Parameters({
-            @Parameter(name = "workFlowCode", description = 
"PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = 
Long.class)),
-            @Parameter(name = "taskCode", description = 
"TASK_DEFINITION_CODE", required = false, schema = @Schema(implementation = 
Long.class, example = "123456789")),
+            @Parameter(name = "projectCode", description = 
"PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = 
long.class)),
+            @Parameter(name = "workFlowCode", description = 
"PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = 
long.class)),
     })
     @GetMapping(value = "/query-dependent-tasks")
     @ResponseStatus(HttpStatus.OK)
     @ApiException(QUERY_WORKFLOW_LINEAGE_ERROR)
-    public Result<Map<String, Object>> 
queryDownstreamDependentTaskList(@Parameter(hidden = true) 
@RequestAttribute(value = SESSION_USER) User loginUser,
-                                                                        
@RequestParam(value = "workFlowCode") Long workFlowCode,
-                                                                        
@RequestParam(value = "taskCode", required = false, defaultValue = "0") Long 
taskCode) {
-        Map<String, Object> result =
-                
workFlowLineageService.queryDownstreamDependentTasks(workFlowCode, taskCode);
-        return returnDataList(result);
+    public Result<Map<String, Object>> queryDependentTasks(@Parameter(hidden = 
true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,

Review Comment:
   ## Useless parameter
   
   The parameter 'loginUser' is never used.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4230)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessLineageController.java:
##########
@@ -61,21 +61,21 @@
 @RestController
 @RequestMapping("projects/{projectCode}/lineages")
 @Slf4j
-public class WorkFlowLineageController extends BaseController {
+public class ProcessLineageController extends BaseController {
 
     @Autowired
-    private WorkFlowLineageService workFlowLineageService;
+    private ProcessLineageService processLineageService;
 
     @Operation(summary = "queryLineageByWorkFlowName", description = 
"QUERY_WORKFLOW_LINEAGE_BY_NAME_NOTES")
     @GetMapping(value = "/query-by-name")
     @ResponseStatus(HttpStatus.OK)
     @ApiException(QUERY_WORKFLOW_LINEAGE_ERROR)
-    public Result<List<WorkFlowLineage>> 
queryWorkFlowLineageByName(@Parameter(hidden = true) @RequestAttribute(value = 
SESSION_USER) User loginUser,
-                                                                    
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) 
@PathVariable long projectCode,
-                                                                    
@RequestParam(value = "workFlowName", required = false) String workFlowName) {
-        workFlowName = ParameterUtils.handleEscapes(workFlowName);
-        List<WorkFlowLineage> workFlowLineages =
-                workFlowLineageService.queryWorkFlowLineageByName(projectCode, 
workFlowName);
+    public Result<List<WorkFlowRelationDetail>> 
queryWorkFlowLineageByName(@Parameter(hidden = true) @RequestAttribute(value = 
SESSION_USER) User loginUser,

Review Comment:
   ## Useless parameter
   
   The parameter 'loginUser' is never used.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4234)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -407,11 +413,64 @@
                     processDefinition.getProjectCode(), 
processDefinition.getCode(), insertVersion);
         }
 
+        saveProcessLineage(taskDefinitionLogs, 
processDefinition.getProjectCode(), processDefinition.getCode(),
+                insertVersion);
+
         putMsg(result, Status.SUCCESS);
         result.put(Constants.DATA_LIST, processDefinition);
         return result;
     }
 
+    public void saveProcessLineage(List<TaskDefinitionLog> 
taskDefinitionLogList,

Review Comment:
   ## Missing Override annotation
   
   This method overrides [ProcessDefinitionService.saveProcessLineage](1); it 
is advisable to add an Override annotation.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4236)



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/lineage/MigrateLineageService.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.tools.lineage;
+
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
+import org.apache.dolphinscheduler.dao.entity.ProcessLineage;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
+import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProcessLineageMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
+import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
+import org.apache.dolphinscheduler.plugin.task.api.model.DependentItem;
+import org.apache.dolphinscheduler.plugin.task.api.model.DependentTaskModel;
+import 
org.apache.dolphinscheduler.plugin.task.api.parameters.DependentParameters;
+import 
org.apache.dolphinscheduler.plugin.task.api.task.DependentLogicTaskChannelFactory;
+
+import org.apache.commons.collections.CollectionUtils;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class MigrateLineageService {
+
+    @Autowired
+    private TaskDefinitionMapper taskDefinitionMapper;
+
+    @Autowired
+    private ProcessLineageMapper processLineageMapper;
+
+    @Autowired
+    private ProcessTaskRelationMapper processTaskRelationMapper;
+
+    @Autowired
+    private ProcessDefinitionMapper processDefinitionMapper;
+
+    public void migrateLineageOnce() {
+        try {
+            List<ProcessLineage> processLineageList = getAllProcessLineages();
+            processLineageMapper.truncateTable();
+            int insertResult = 
processLineageMapper.batchInsert(processLineageList);
+            if (insertResult > 0) {
+                log.info("Migrate lineage successfully, insert count: {}", 
insertResult);
+            } else {
+                log.info("No lineage to migrate.");
+            }
+        } catch (Exception e) {
+            log.error("Failed to migrate lineage:", e);
+        }
+    }
+
+    private List<ProcessLineage> getAllProcessLineages() throws SQLException {
+        List<TaskDefinition> taskDefinitionList =
+                
taskDefinitionMapper.queryDefinitionsByTaskType(DependentLogicTaskChannelFactory.NAME);
+        List<ProcessTaskRelation> processTaskRelationList =
+                
processTaskRelationMapper.queryByTaskCodes(taskDefinitionList.stream()
+                        .map(TaskDefinition::getCode).toArray(Long[]::new));
+        List<ProcessDefinition> processDefinitionList =
+                
processDefinitionMapper.queryByCodes(processTaskRelationList.stream()
+                        
.map(ProcessTaskRelation::getProcessDefinitionCode).collect(Collectors.toList()));

Review Comment:
   ## Unread local variable
   
   Variable 'List<ProcessDefinition> processDefinitionList' is never read.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4229)



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessLineageServiceImpl.java:
##########
@@ -0,0 +1,320 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.api.service.impl;
+
+import org.apache.dolphinscheduler.api.enums.Status;
+import org.apache.dolphinscheduler.api.exceptions.ServiceException;
+import org.apache.dolphinscheduler.api.service.ProcessLineageService;
+import org.apache.dolphinscheduler.common.constants.Constants;
+import org.apache.dolphinscheduler.dao.entity.DependentLineageTask;
+import org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
+import org.apache.dolphinscheduler.dao.entity.ProcessLineage;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
+import org.apache.dolphinscheduler.dao.entity.WorkFlowRelation;
+import org.apache.dolphinscheduler.dao.entity.WorkFlowRelationDetail;
+import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProcessLineageMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
+import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * work flow lineage service impl
+ */
+@Slf4j
+@Service
+public class ProcessLineageServiceImpl extends BaseServiceImpl implements 
ProcessLineageService {
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private TaskDefinitionLogMapper taskDefinitionLogMapper;
+
+    @Autowired
+    private TaskDefinitionMapper taskDefinitionMapper;
+
+    @Autowired
+    private ProcessLineageMapper processLineageMapper;
+    @Autowired
+    private ProcessDefinitionMapper processDefinitionMapper;
+
+    @Override
+    public List<WorkFlowRelationDetail> queryWorkFlowLineageByName(long 
projectCode, String processDefinitionName) {
+        Project project = projectMapper.queryByCode(projectCode);
+        if (project == null) {
+            throw new ServiceException(Status.PROJECT_NOT_FOUND, projectCode);
+        }
+        return processLineageMapper.queryWorkFlowLineageByName(projectCode, 
processDefinitionName);
+    }
+
+    @Override
+    public Map<String, Object> queryWorkFlowLineageByCode(long projectCode, 
long processDefinitionCode) {
+        Map<String, Object> result = new HashMap<>();
+        Project project = projectMapper.queryByCode(projectCode);
+        if (project == null) {
+            log.error("Project does not exist, projectCode:{}.", projectCode);
+            putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
+            return result;
+        }
+        List<ProcessLineage> upstreamProcessLineageList =
+                
processLineageMapper.queryByProcessDefinitionCode(processDefinitionCode);
+        List<ProcessLineage> downstreamProcessLineageList =
+                processLineageMapper.queryWorkFlowLineageByDept(projectCode, 
processDefinitionCode, 0);
+        List<ProcessLineage> totalProcessLineageList =
+                Stream.of(upstreamProcessLineageList, 
downstreamProcessLineageList)
+                        .flatMap(List::stream)
+                        .collect(Collectors.toList());
+
+        List<WorkFlowRelation> workFlowRelationList = 
getWorkFlowRelations(totalProcessLineageList);
+        List<WorkFlowRelationDetail> workFlowRelationDetailList =
+                getWorkflowRelationDetails(totalProcessLineageList.stream()
+                        .flatMap(pl -> {
+                            List<Long> processDefinitionCodes = new 
ArrayList<>();
+                            
processDefinitionCodes.add(pl.getProcessDefinitionCode());
+                            
processDefinitionCodes.add(pl.getDeptProcessDefinitionCode());
+                            return processDefinitionCodes.stream();
+                        }).distinct().collect(Collectors.toList()));
+
+        Map<String, Object> workFlowLists = new HashMap<>();
+        workFlowLists.put(Constants.WORKFLOW_RELATION_DETAIL_LIST, 
workFlowRelationDetailList);
+        workFlowLists.put(Constants.WORKFLOW_RELATION_LIST, 
workFlowRelationList);
+        result.put(Constants.DATA_LIST, workFlowLists);
+        putMsg(result, Status.SUCCESS);
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> queryWorkFlowLineage(long projectCode) {
+        Map<String, Object> result = new HashMap<>();
+        Project project = projectMapper.queryByCode(projectCode);
+        if (project == null) {
+            log.error("Project does not exist, projectCode:{}.", projectCode);
+            putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
+            return result;
+        }
+        List<ProcessLineage> processLineageList = 
processLineageMapper.queryByProjectCode(projectCode);
+        List<WorkFlowRelation> workFlowRelationList = 
getWorkFlowRelations(processLineageList);
+        List<WorkFlowRelationDetail> workFlowRelationDetailList = 
getWorkflowRelationDetails(processLineageList.stream()
+                .flatMap(pl -> {
+                    List<Long> processDefinitionCodes = new ArrayList<>();
+                    processDefinitionCodes.add(pl.getProcessDefinitionCode());
+                    
processDefinitionCodes.add(pl.getDeptProcessDefinitionCode());
+                    return processDefinitionCodes.stream();
+                }).distinct().collect(Collectors.toList()));
+
+        Map<String, Object> workFlowLists = new HashMap<>();
+        workFlowLists.put(Constants.WORKFLOW_RELATION_DETAIL_LIST, 
workFlowRelationDetailList);
+        workFlowLists.put(Constants.WORKFLOW_RELATION_LIST, 
workFlowRelationList);
+        result.put(Constants.DATA_LIST, workFlowLists);
+        putMsg(result, Status.SUCCESS);
+        return result;
+    }
+
+    private List<WorkFlowRelation> getWorkFlowRelations(List<ProcessLineage> 
processLineageList) {
+        List<WorkFlowRelation> workFlowRelations = new ArrayList<>();
+        List<Long> processDefinitionCodes = processLineageList.stream()
+                
.map(ProcessLineage::getProcessDefinitionCode).distinct().collect(Collectors.toList());
+        for (ProcessLineage processLineage : processLineageList) {
+            workFlowRelations.add(new 
WorkFlowRelation(processLineage.getDeptProcessDefinitionCode(),
+                    processLineage.getProcessDefinitionCode()));
+
+            if 
(!processDefinitionCodes.contains(processLineage.getDeptProcessDefinitionCode()))
 {
+                workFlowRelations.add(new WorkFlowRelation(0, 
processLineage.getProcessDefinitionCode()));
+            }
+        }
+        return workFlowRelations;
+    }
+
+    private List<WorkFlowRelationDetail> getWorkflowRelationDetails(List<Long> 
processDefinitionCodes) {
+        List<WorkFlowRelationDetail> workFlowRelationDetails = new 
ArrayList<>();
+        for (Long processDefinitionCode : processDefinitionCodes) {
+            List<WorkFlowRelationDetail> workFlowRelationDetailList =
+                    
processLineageMapper.queryWorkFlowLineageByCode(processDefinitionCode);
+            workFlowRelationDetails.addAll(workFlowRelationDetailList);
+        }
+        return workFlowRelationDetails;
+    }
+
+    /**
+     * Query tasks depend on process definition, include upstream or downstream
+     * and return tasks dependence with string format.
+     *
+     * @param projectCode           Project code want to query tasks dependence
+     * @param processDefinitionCode Process definition code want to query 
tasks dependence
+     * @param taskCode              Task code want to query tasks dependence
+     * @return Optional of formatter message
+     */
+    @Override
+    public Optional<String> taskDependentMsg(long projectCode, long 
processDefinitionCode, long taskCode) {
+        long queryTaskCode = 0;
+        if (taskCode != 0) {
+            queryTaskCode = taskCode;
+        }
+        List<ProcessLineage> dependentProcessList =
+                processLineageMapper.queryWorkFlowLineageByDept(projectCode, 
processDefinitionCode, queryTaskCode);
+        if (CollectionUtils.isEmpty(dependentProcessList)) {
+            return Optional.empty();
+        }
+
+        List<String> taskDepStrList = new ArrayList<>();
+
+        for (ProcessLineage processLineage : dependentProcessList) {
+            ProcessDefinition processDefinition =
+                    
processDefinitionMapper.queryByCode(processLineage.getDeptProcessDefinitionCode());
+            String taskName = "";
+            if (processLineage.getTaskDefinitionCode() != 0) {
+                TaskDefinition taskDefinition =
+                        
taskDefinitionMapper.queryByCode(processLineage.getTaskDefinitionCode());
+                taskName = taskDefinition.getName();
+            }
+            taskDepStrList.add(String.format(Constants.FORMAT_S_S_COLON, 
processDefinition.getName(), taskName));
+        }
+
+        String taskDepStr = String.join(Constants.COMMA, taskDepStrList);
+        if (taskCode != 0) {
+            TaskDefinition taskDefinition = 
taskDefinitionMapper.queryByCode(taskCode);
+            return Optional
+                    
.of(MessageFormat.format(Status.DELETE_TASK_USE_BY_OTHER_FAIL.getMsg(), 
taskDefinition.getName(),
+                            taskDepStr));
+        } else {
+            return 
Optional.of(MessageFormat.format(Status.DELETE_TASK_USE_BY_OTHER_FAIL.getMsg(), 
"",
+                    taskDepStr));
+        }
+    }
+
+    /**
+     * Query downstream tasks depend on a process definition or a task
+     *
+     * @param processDefinitionCode Process definition code want to query 
tasks dependence
+     * @return downstream dependent process definition list
+     */
+    @Override
+    public List<DependentProcessDefinition> 
queryDownstreamDependentProcessDefinitions(Long processDefinitionCode) {
+        List<DependentProcessDefinition> dependentProcessDefinitionList = new 
ArrayList<>();
+        List<ProcessLineage> processLineageList =
+                processLineageMapper.queryWorkFlowLineageByDept(0, 
processDefinitionCode, 0);
+        if (processLineageList.isEmpty()) {
+            return dependentProcessDefinitionList;
+        }
+
+        List<ProcessDefinition> processDefinitionList = 
processDefinitionMapper.queryByCodes(processLineageList.stream()
+                
.map(ProcessLineage::getDeptProcessDefinitionCode).distinct().collect(Collectors.toList()));
+        List<TaskDefinition> taskDefinitionList = 
taskDefinitionMapper.queryByCodeList(processLineageList.stream()
+                
.map(ProcessLineage::getDeptTaskDefinitionCode).distinct().collect(Collectors.toList()));
+        for (TaskDefinition taskDefinition : taskDefinitionList) {
+            DependentProcessDefinition dependentProcessDefinition = new 
DependentProcessDefinition();
+            processLineageList.stream()
+                    .filter(processLineage -> 
processLineage.getDeptTaskDefinitionCode() == taskDefinition.getCode())
+                    .findFirst()
+                    .ifPresent(processLineage -> {
+                        dependentProcessDefinition
+                                
.setProcessDefinitionCode(processLineage.getDeptProcessDefinitionCode());
+                        
dependentProcessDefinition.setTaskDefinitionCode(taskDefinition.getCode());
+                        
dependentProcessDefinition.setTaskParams(taskDefinition.getTaskParams());
+                        
dependentProcessDefinition.setWorkerGroup(taskDefinition.getWorkerGroup());
+                    });
+            processDefinitionList.stream()
+                    .filter(processDefinition -> processDefinition.getCode() 
== dependentProcessDefinition
+                            .getProcessDefinitionCode())
+                    .findFirst()
+                    .ifPresent(processDefinition -> {
+                        
dependentProcessDefinition.setProcessDefinitionVersion(processDefinition.getVersion());
+                    });
+        }
+
+        return dependentProcessDefinitionList;
+    }
+
+    public Map<String, Object> queryDependentProcessDefinitions(long 
projectCode, long processDefinitionCode,

Review Comment:
   ## Missing Override annotation
   
   This method overrides 
[ProcessLineageService.queryDependentProcessDefinitions](1); it is advisable to 
add an Override annotation.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/4235)



-- 
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]

Reply via email to