zhuangchong opened a new pull request #3582:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3582


   
   ## What is the purpose of the pull request
   
   The workflow definition deletion function is added to check whether there 
are running workflow instances according to the workflow definition ID and 
running status. If there are running workflow instances, they are not allowed 
to be deleted, and a friendly prompt will be given.    #3581
   
   ## Brief change log
   
   New running workflow instance check
   
   ProcessDefinitionServiceImpl.deleteProcessDefinitionById
   
   ```
     // check process instances is already running
           List<ProcessInstance> processInstances =  
processInstanceMapper.queryByProcessDefineIdAndStatus(processDefinitionId, 
Constants.NOT_TERMINATED_STATES);
           if(CollectionUtils.isNotEmpty(processInstances)){
               putMsg(result, 
Status.DELETE_PROCESS_DEFINITION_BY_ID_FAIL,processInstances.size());
               return result;
           }
   
   ```
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is already covered by existing tests, such as *(please 
describe tests)*.
   
   ProcessDefinitionControllerTest.testDeleteProcessDefinitionById()
   
   ----
   
   ##拉取请求的目的是什么
   
   工作流定义删除功能,新增根据工作流定义ID和运行状态,检查是否有正在运行的工作流实例,如果有正在运行的工作流实例,不允许删除,友情提示。
   
   ##简要变更日志
   
   新增正在运行工作流实例检查
   
   ProcessDefinitionServiceImpl.deleteProcessDefinitionById
   
   ```
     // check process instances is already running
           List<ProcessInstance> processInstances =  
processInstanceMapper.queryByProcessDefineIdAndStatus(processDefinitionId, 
Constants.NOT_TERMINATED_STATES);
           if(CollectionUtils.isNotEmpty(processInstances)){
               putMsg(result, 
Status.DELETE_PROCESS_DEFINITION_BY_ID_FAIL,processInstances.size());
               return result;
           }
   
   ```
   
   ##验证此请求
   
   *(请选择以下任一选项)*
   
   此请求已被现有测试覆盖,例如*(请描述测试)*。
   
   ProcessDefinitionControllerTest.testDeleteProcessDefinitionById()
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to