未验证 提交 42ba593a 编写于 作者: J JinYong Li 提交者: GitHub

[Fix-10762] [bug] Dependent tasks wait for the workflow to end (#10765)

* issue 8645 (#8811)
Co-authored-by: N北笙 <“zhanqian@cai-inc.com”>
Co-authored-by: Nzhanqian <zhanqian@cai-inc.com>

* [fix-8929][DAO]Description Failed to upload the file because the full name was too long (#9020)

* [fix-8929][DAO]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long

* [DS-#8929][fix]Description Failed to upload the file because the full name was too long
Co-authored-by: Nhoushuai <houshuai@jiguang.cn>

* [BUG][ALERT-SERVER]validate script before alert script (#9834)

* validate script before alert script

* fix validate script before alert script

* pick 8811/9020/9834

* fix ut

* fix pick error

* fix 10762
Co-authored-by: Nzhanqian <360400325@qq.com>
Co-authored-by: N北笙 <“zhanqian@cai-inc.com”>
Co-authored-by: Nzhanqian <zhanqian@cai-inc.com>
Co-authored-by: Nshuai hou <120306274@qq.com>
Co-authored-by: Nhoushuai <houshuai@jiguang.cn>
Co-authored-by: NTq <tianqitobethefirst@gmail.com>
Co-authored-by: NJinyLeeChina <jiny.li@foxmail.com>
上级 23fae510
......@@ -64,6 +64,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;
......
......@@ -115,16 +115,16 @@ public class DependentExecute {
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode());
return DependResult.WAITING;
}
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, processDefiniteCode:{}, taskCode:{}, processInstanceId:{}, processInstance state:{}",
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode(), processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
// need to check workflow for updates, so get all task and check the task state
if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) {
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, processDefiniteCode:{}, taskCode:{}, processInstanceId:{}, processInstance state:{}",
dependentItem.getDefinitionCode(), dependentItem.getDepTaskCode(), processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
result = dependResultByProcessInstance(processInstance, dateInterval);
} else {
result = getDependTaskResult(dependentItem.getDepTaskCode(), dateInterval);
result = getDependTaskResult(processInstance, dependentItem.getDepTaskCode(), dateInterval);
}
if (result != DependResult.SUCCESS) {
break;
......@@ -192,10 +192,15 @@ public class DependentExecute {
/**
* get depend task result
*/
private DependResult getDependTaskResult(long taskCode, DateInterval dateInterval) {
private DependResult getDependTaskResult(ProcessInstance processInstance, long taskCode, DateInterval dateInterval) {
TaskInstance taskInstance = processService.findLastTaskInstanceInterval(taskCode, dateInterval);
DependResult result;
if (taskInstance == null) {
if (!processInstance.getState().typeIsFinished()) {
logger.info("Wait for the dependent workflow to complete, taskCode:{}, processInstanceId:{}, processInstance state:{}",
taskCode, processInstance.getId(), processInstance.getState());
return DependResult.WAITING;
}
TaskDefinition taskDefinition = processService.findTaskDefinitionByCode(taskCode);
if (taskDefinition == null) {
logger.error("Cannot find the task definition, something error, taskCode: {}", taskCode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册