[Feature][API] process definition delete api add check process instance is already running. #3581#3582
Merged
qiaozhanwei merged 5 commits intoapache:devfrom Sep 7, 2020
Conversation
qiaozhanwei
approved these changes
Aug 25, 2020
Contributor
Author
ok,resolved |
yangyichao-mango
requested changes
Aug 26, 2020
Comment on lines
+492
to
+496
| 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; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| 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; | |
| } | |
| List<ProcessInstance> processInstances = processInstanceService.queryByProcessDefineIdAndStatus(processDefinitionId, Constants.NOT_TERMINATED_STATES); | |
| if (CollectionUtils.isNotEmpty(processInstances)) { | |
| putMsg(result, Status.DELETE_PROCESS_DEFINITION_BY_ID_FAIL,processInstances.size()); | |
| return result; | |
| } |
Hi,
In processDefinitionService service layer, it is not recommended straightly use processInstanceMapper dao layer, this part should be in processInstanceService, use processInstanceService here.
Contributor
Author
There was a problem hiding this comment.
Processinstanceservice has been used. Processinstanceservice should implement the interface. There are contributors who have submitted branches. I have not changed this.
已使用processInstanceService ,processInstanceService 应该实现接口,已经有贡献者提交分支,这块我没有改.
|
Kudos, SonarCloud Quality Gate passed!
|
Contributor
Author
|
@dailidong @qiaozhanwei done. Please help to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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
##验证此请求
(请选择以下任一选项)
此请求已被现有测试覆盖,例如*(请描述测试)*。
ProcessDefinitionControllerTest.testDeleteProcessDefinitionById()