Przeglądaj źródła

取消异步处理,防止流程状态扭转后数据没有保存成功

wy 2 lat temu
rodzic
commit
08eece12e2

+ 6 - 6
ibps-bpmn-root/modules/bpmn-biz/src/main/java/com/lc/ibps/bpmn/service/impl/BpmTaskActionServiceImpl.java

@@ -191,10 +191,10 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
 			ITaskActionHandlerDefine def = (ITaskActionHandlerDefine)taskActionHandlerConfig.getTaskActionHandlerDef(taskCmd.getActionName());
 			//执行和返回
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "execute");
-			new Thread(() ->{
+			//new Thread(() ->{
 				//boolean result =h handler.execute(taskActionPluginSession,def);
-				handler.execute(taskActionPluginSession,def);//TODO 性能很低
-			}).start();
+			Boolean exe = handler.execute(taskActionPluginSession, def);//TODO 性能很低
+			//}).start();w
 			//后置事件抛出
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "publicDoNextEvent.post");
 			AppUtil.publishEvent(getDoNextEvent(cmd, AopType.POST));
@@ -203,7 +203,7 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "clearTaskByInstId");
 			BpmnContextUtil.clearTaskByInstId(taskCmd.getInstId());
 
-			//if(result) {
+			if(exe) {
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "updataTimes");
 			bpmCommonStatmentService.updateTimes(cmd.getApprovalOpinion(), cmd.getCurUser(), cmd.getActionName());
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "getActionCmd.1");
@@ -216,8 +216,8 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
 				BpmExecUtil.multipleInstancesRejectAdjust(rejectAfterExecutionId.toString());
 			}
 			return true;
-			//	}
-			//throw new BaseException("任务办理失败");
+				}
+			throw new BaseException("任务办理失败");
 		}
 		catch (Exception e) {
 			Throwable t = e.getCause();//org.activiti.engine.ActivitiException