DarkAssassinator commented on code in PR #12264:
URL: https://github.com/apache/dolphinscheduler/pull/12264#discussion_r990777078


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java:
##########
@@ -335,6 +339,19 @@ public Result queryProcessInstanceList(User loginUser, 
long projectCode, long pr
         return result;
     }
 
+    /**
+     * check if the processInstance is finish
+     * @param processInstance processInstance
+     * @return result
+     */
+    private boolean isFinish(ProcessInstance processInstance){
+        if (processInstance.getState() == null) {
+            return false;
+        }
+        return 
!processInstance.getState().equals(WorkflowExecutionStatus.RUNNING_EXECUTION)

Review Comment:
   has removed this new function, use the common 
`processInstance.getState().isFinished()`



##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java:
##########
@@ -270,20 +270,48 @@ public void testQueryTopNLongestRunningProcessInstance() {
         // project auth fail
         when(projectMapper.queryByCode(projectCode)).thenReturn(project);
         when(projectService.checkProjectAndAuth(loginUser, project, 
projectCode, WORKFLOW_INSTANCE)).thenReturn(result);
-        Map<String, Object> proejctAuthFailRes = processInstanceService
+        Map<String, Object> projectAuthFailRes = processInstanceService
                 .queryTopNLongestRunningProcessInstance(loginUser, 
projectCode, size, startTime, endTime);
-        Assert.assertEquals(Status.PROJECT_NOT_FOUND, 
proejctAuthFailRes.get(Constants.STATUS));
+        Assert.assertEquals(Status.PROJECT_NOT_FOUND, 
projectAuthFailRes.get(Constants.STATUS));
 
         // project auth success
         putMsg(result, Status.SUCCESS, projectCode);
         ProcessInstance processInstance = getProcessInstance();
         when(projectMapper.queryByCode(projectCode)).thenReturn(project);
         when(projectService.checkProjectAndAuth(loginUser, project, 
projectCode, WORKFLOW_INSTANCE)).thenReturn(result);
+        projectAuthFailRes = processInstanceService

Review Comment:
   done 



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