@ -805,7 +805,8 @@ public class MasterExecThread implements Runnable {
ProcessInstance instance = processService . findProcessInstanceById ( processInstance . getId ( ) ) ;
ProcessInstance instance = processService . findProcessInstanceById ( processInstance . getId ( ) ) ;
ExecutionStatus state = instance . getState ( ) ;
ExecutionStatus state = instance . getState ( ) ;
if ( activeTaskNode . size ( ) > 0 | | haveRetryTaskStandBy ( ) ) {
if ( activeTaskNode . size ( ) > 0 | | retryTaskExists ( ) ) {
// active task and retry task exists
return runningState ( state ) ;
return runningState ( state ) ;
}
}
// process failure
// process failure
@ -828,7 +829,8 @@ public class MasterExecThread implements Runnable {
List < TaskInstance > stopList = getCompleteTaskByState ( ExecutionStatus . STOP ) ;
List < TaskInstance > stopList = getCompleteTaskByState ( ExecutionStatus . STOP ) ;
List < TaskInstance > killList = getCompleteTaskByState ( ExecutionStatus . KILL ) ;
List < TaskInstance > killList = getCompleteTaskByState ( ExecutionStatus . KILL ) ;
if ( CollectionUtils . isNotEmpty ( stopList )
if ( CollectionUtils . isNotEmpty ( stopList )
| | CollectionUtils . isNotEmpty ( killList ) | | ! isComplementEnd ( ) ) {
| | CollectionUtils . isNotEmpty ( killList )
| | ! isComplementEnd ( ) ) {
return ExecutionStatus . STOP ;
return ExecutionStatus . STOP ;
} else {
} else {
return ExecutionStatus . SUCCESS ;
return ExecutionStatus . SUCCESS ;
@ -837,9 +839,13 @@ public class MasterExecThread implements Runnable {
// success
// success
if ( state = = ExecutionStatus . RUNNING_EXEUTION ) {
if ( state = = ExecutionStatus . RUNNING_EXEUTION ) {
List < TaskInstance > killTasks = getCompleteTaskByState ( ExecutionStatus . KILL ) ;
if ( readyToSubmitTaskList . size ( ) > 0 ) {
if ( readyToSubmitTaskList . size ( ) > 0 ) {
//tasks currently pending submission, no retries, indicating that depend is waiting to complete
//tasks currently pending submission, no retries, indicating that depend is waiting to complete
return ExecutionStatus . RUNNING_EXEUTION ;
return ExecutionStatus . RUNNING_EXEUTION ;
} else if ( CollectionUtils . isNotEmpty ( killTasks ) ) {
// tasks maybe killed manually
return ExecutionStatus . FAILURE ;
} else {
} else {
// if the waiting queue is empty and the status is in progress, then success
// if the waiting queue is empty and the status is in progress, then success
return ExecutionStatus . SUCCESS ;
return ExecutionStatus . SUCCESS ;
@ -853,7 +859,7 @@ public class MasterExecThread implements Runnable {
* whether standby task list have retry tasks
* whether standby task list have retry tasks
* @return
* @return
* /
* /
private boolean haveRetryTaskStandBy ( ) {
private boolean retryTaskExists ( ) {
boolean result = false ;
boolean result = false ;