|
@@ -113,7 +113,7 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
|
|
|
}
|
|
}
|
|
|
// 校验节点执行是否符合时间设置
|
|
// 校验节点执行是否符合时间设置
|
|
|
CompanyAiWorkflowExec timeAvailable = companyAiWorkflowExecMapper.selectExecWithTimeAvailableByInstanceId(context.getWorkflowInstanceId());
|
|
CompanyAiWorkflowExec timeAvailable = companyAiWorkflowExecMapper.selectExecWithTimeAvailableByInstanceId(context.getWorkflowInstanceId());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (timeAvailable == null) {
|
|
if (timeAvailable == null) {
|
|
|
CompanyAiWorkflowExec exec = companyAiWorkflowExecMapper.selectByWorkflowInstanceId(context.getWorkflowInstanceId());
|
|
CompanyAiWorkflowExec exec = companyAiWorkflowExecMapper.selectByWorkflowInstanceId(context.getWorkflowInstanceId());
|
|
|
if (exec == null) {
|
|
if (exec == null) {
|
|
@@ -130,7 +130,7 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
|
|
|
log.info("当前流程不在可执行时间范围内 continue已被阻塞等待唤醒执行,节点执行等待:- {},- {} -,{}" , nodeName, nodeKey, context.getWorkflowInstanceId());
|
|
log.info("当前流程不在可执行时间范围内 continue已被阻塞等待唤醒执行,节点执行等待:- {},- {} -,{}" , nodeName, nodeKey, context.getWorkflowInstanceId());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
RLock lock = null;
|
|
RLock lock = null;
|
|
|
try {
|
|
try {
|
|
|
String lockKey = NODE_EXEC_LOCK_PREFIX + context.getWorkflowInstanceId();
|
|
String lockKey = NODE_EXEC_LOCK_PREFIX + context.getWorkflowInstanceId();
|
|
@@ -150,7 +150,8 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
|
|
|
context.setVariable("currentNode", node);
|
|
context.setVariable("currentNode", node);
|
|
|
// 允许 PAUSED 或 WAITING 状态继续执行
|
|
// 允许 PAUSED 或 WAITING 状态继续执行
|
|
|
if (!Integer.valueOf(ExecutionStatusEnum.PAUSED.getValue()).equals(companyAiWorkflowExec.getStatus())
|
|
if (!Integer.valueOf(ExecutionStatusEnum.PAUSED.getValue()).equals(companyAiWorkflowExec.getStatus())
|
|
|
- && !Integer.valueOf(ExecutionStatusEnum.WAITING.getValue()).equals(companyAiWorkflowExec.getStatus())) {
|
|
|
|
|
|
|
+ && !Integer.valueOf(ExecutionStatusEnum.WAITING.getValue()).equals(companyAiWorkflowExec.getStatus())
|
|
|
|
|
+ && !Integer.valueOf(ExecutionStatusEnum.WAITING_DO_CALL.getValue()).equals(companyAiWorkflowExec.getStatus())) {
|
|
|
log.error("工作流状态不符合 - workflowInstanceId: {}, 当前状态: {}, 期望状态: PAUSED({}) 或 WAITING({})",
|
|
log.error("工作流状态不符合 - workflowInstanceId: {}, 当前状态: {}, 期望状态: PAUSED({}) 或 WAITING({})",
|
|
|
context.getWorkflowInstanceId(), companyAiWorkflowExec.getStatus(),
|
|
context.getWorkflowInstanceId(), companyAiWorkflowExec.getStatus(),
|
|
|
ExecutionStatusEnum.PAUSED.getValue(), ExecutionStatusEnum.WAITING.getValue());
|
|
ExecutionStatusEnum.PAUSED.getValue(), ExecutionStatusEnum.WAITING.getValue());
|
|
@@ -163,9 +164,14 @@ public abstract class AbstractWorkflowNode implements IWorkflowNode {
|
|
|
if (lock != null && lock.isHeldByCurrentThread()) {
|
|
if (lock != null && lock.isHeldByCurrentThread()) {
|
|
|
if(getType().equals(NodeTypeEnum.AI_CALL_TASK)){
|
|
if(getType().equals(NodeTypeEnum.AI_CALL_TASK)){
|
|
|
updateLogStatusIfExist(context,ExecutionStatusEnum.PAUSED,ExecutionStatusEnum.SUCCESS);
|
|
updateLogStatusIfExist(context,ExecutionStatusEnum.PAUSED,ExecutionStatusEnum.SUCCESS);
|
|
|
- }
|
|
|
|
|
- else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK)){
|
|
|
|
|
|
|
+ } else if(getType().equals(NodeTypeEnum.AI_CALL_TASK)){
|
|
|
|
|
+ updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING_DO_CALL,ExecutionStatusEnum.SUCCESS);
|
|
|
|
|
+ } else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK)){
|
|
|
|
|
+ updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING,ExecutionStatusEnum.SUCCESS);
|
|
|
|
|
+ } else if(getType().equals(NodeTypeEnum.AI_ADD_WX_TASK_NEW)){
|
|
|
updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING,ExecutionStatusEnum.SUCCESS);
|
|
updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING,ExecutionStatusEnum.SUCCESS);
|
|
|
|
|
+ } else if (getType().equals(NodeTypeEnum.OUTBOUND_TASK)) {
|
|
|
|
|
+ updateLogStatusIfExist(context,ExecutionStatusEnum.WAITING_DO_CALL,ExecutionStatusEnum.SUCCESS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// //更新流程日志信息
|
|
// //更新流程日志信息
|