zwZjut commented on a change in pull request #7082:
URL: https://github.com/apache/dolphinscheduler/pull/7082#discussion_r759466294



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java
##########
@@ -171,6 +176,12 @@ public Result queryTaskListPaging(User loginUser,
             return result;
         }
 
+        TaskDefinition taskDefinition = 
taskDefinitionMapper.queryByCode(task.getTaskCode());
+        if (taskDefinition != null && projectCode != 
taskDefinition.getProjectCode()) {
+            putMsg(result, Status.TASK_INSTANCE_NOT_FOUND, taskInstanceId);

Review comment:
       The purpose is to determine whether TaskInstance belongs to the project, 
 but  project_code is not in table t_ds_task_instance, now we have to query 
t_ds_task_definition to judge  whether TaskInstance belongs to project , if 
(taskDefinition != null && projectCode != taskDefinition.getProjectCode()) 
means taskInstanceId  does not belong to the project, so we need throw message 
TASK_INSTANCE_NOT_FOUND in this project




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