|
@@ -1637,7 +1637,9 @@ public class WorkflowExecuteThread {
|
|
|
stateEvent.setExecutionStatus(processInstance.getState());
|
|
|
stateEvent.setProcessInstanceId(this.processInstance.getId());
|
|
|
stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE);
|
|
|
- this.processStateChangeHandler(stateEvent);
|
|
|
+// this.processStateChangeHandler(stateEvent);
|
|
|
+ // replace with `stateEvents`, make sure `WorkflowExecuteThread` can be deleted to avoid memory leaks
|
|
|
+ this.stateEvents.add(stateEvent);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1800,6 +1802,11 @@ public class WorkflowExecuteThread {
|
|
|
TaskInstance taskInstance = submitTaskExec(task);
|
|
|
if (taskInstance == null) {
|
|
|
this.taskFailedSubmit = true;
|
|
|
+ // Remove and add to complete map and error map
|
|
|
+ removeTaskFromStandbyList(task);
|
|
|
+ completeTaskMap.put(task.getTaskCode(), task.getId());
|
|
|
+ errorTaskMap.put(task.getTaskCode(), task.getId());
|
|
|
+ logger.error("process {}, task {}, code:{} submit task failed.", task.getProcessInstanceId(), task.getName(), task.getTaskCode());
|
|
|
} else {
|
|
|
removeTaskFromStandbyList(task);
|
|
|
}
|