|
|
@@ -172,10 +172,13 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
|
|
|
StopWatchUtil.stopAndStartNewLocal(localId, step, "getByTaskId");
|
|
|
task=natTaskService.getByTaskId(bpmTask.getTaskId());//TODO 性能略低
|
|
|
}
|
|
|
-
|
|
|
- //前置事件抛出
|
|
|
- StopWatchUtil.stopAndStartNewLocal(localId, step, "publicDoNextEvent.prev");
|
|
|
- AppUtil.publishEvent(getDoNextEvent(cmd, AopType.PREV));//TODO 性能很低
|
|
|
+ new Thread(() ->{
|
|
|
+ StopWatchUtil.stopAndStartNewLocal(localId, step, "publicDoNextEvent.prev");
|
|
|
+ AppUtil.publishEvent(getDoNextEvent(cmd, AopType.PREV));//TODO 性能很低
|
|
|
+ }).start();
|
|
|
+ //前置事件抛出 改异步
|
|
|
+ //StopWatchUtil.stopAndStartNewLocal(localId, step, "publicDoNextEvent.prev");
|
|
|
+ //AppUtil.publishEvent(getDoNextEvent(cmd, AopType.PREV));//TODO 性能很低
|
|
|
|
|
|
//构造会话数据
|
|
|
StopWatchUtil.stopAndStartNewLocal(localId, step, "buildTaskActionPluginSession");
|
|
|
@@ -188,8 +191,10 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
|
|
|
ITaskActionHandlerDefine def = (ITaskActionHandlerDefine)taskActionHandlerConfig.getTaskActionHandlerDef(taskCmd.getActionName());
|
|
|
//执行和返回
|
|
|
StopWatchUtil.stopAndStartNewLocal(localId, step, "execute");
|
|
|
- boolean result = handler.execute(taskActionPluginSession,def);//TODO 性能很低
|
|
|
-
|
|
|
+ new Thread(() ->{
|
|
|
+ //boolean result =h handler.execute(taskActionPluginSession,def);
|
|
|
+ handler.execute(taskActionPluginSession,def);//TODO 性能很低
|
|
|
+ }).start();
|
|
|
//后置事件抛出
|
|
|
StopWatchUtil.stopAndStartNewLocal(localId, step, "publicDoNextEvent.post");
|
|
|
AppUtil.publishEvent(getDoNextEvent(cmd, AopType.POST));
|
|
|
@@ -198,22 +203,21 @@ public class BpmTaskActionServiceImpl implements BpmTaskActionService{
|
|
|
StopWatchUtil.stopAndStartNewLocal(localId, step, "clearTaskByInstId");
|
|
|
BpmnContextUtil.clearTaskByInstId(taskCmd.getInstId());
|
|
|
|
|
|
- if(result) {
|
|
|
- StopWatchUtil.stopAndStartNewLocal(localId, step, "updataTimes");
|
|
|
- bpmCommonStatmentService.updateTimes(cmd.getApprovalOpinion(),cmd.getCurUser(),cmd.getActionName());
|
|
|
- StopWatchUtil.stopAndStartNewLocal(localId, step, "getActionCmd.1");
|
|
|
- ActionCmd finsActionCmd = BpmnContextUtil.getActionCmd(cmd.getInstId());
|
|
|
- StopWatchUtil.stopAndStartNewLocal(localId, step, "getTransitVars.1");
|
|
|
- Object rejectAfterExecutionId = finsActionCmd.getTransitVars("rejectAfterExecutionId");
|
|
|
- if (rejectAfterExecutionId != null && StringUtil.isNotEmpty(rejectAfterExecutionId.toString())) {
|
|
|
- // 调整Activiti的执行表数据
|
|
|
- StopWatchUtil.stopAndStartNewLocal(localId, step, "multipleInstancesRejectAdjust");
|
|
|
- BpmExecUtil.multipleInstancesRejectAdjust(rejectAfterExecutionId.toString());
|
|
|
- }
|
|
|
- return true;
|
|
|
+ //if(result) {
|
|
|
+ StopWatchUtil.stopAndStartNewLocal(localId, step, "updataTimes");
|
|
|
+ bpmCommonStatmentService.updateTimes(cmd.getApprovalOpinion(), cmd.getCurUser(), cmd.getActionName());
|
|
|
+ StopWatchUtil.stopAndStartNewLocal(localId, step, "getActionCmd.1");
|
|
|
+ ActionCmd finsActionCmd = BpmnContextUtil.getActionCmd(cmd.getInstId());
|
|
|
+ StopWatchUtil.stopAndStartNewLocal(localId, step, "getTransitVars.1");
|
|
|
+ Object rejectAfterExecutionId = finsActionCmd.getTransitVars("rejectAfterExecutionId");
|
|
|
+ if (rejectAfterExecutionId != null && StringUtil.isNotEmpty(rejectAfterExecutionId.toString())) {
|
|
|
+ // 调整Activiti的执行表数据
|
|
|
+ StopWatchUtil.stopAndStartNewLocal(localId, step, "multipleInstancesRejectAdjust");
|
|
|
+ BpmExecUtil.multipleInstancesRejectAdjust(rejectAfterExecutionId.toString());
|
|
|
}
|
|
|
-
|
|
|
- throw new BaseException("任务办理失败");
|
|
|
+ return true;
|
|
|
+ // }
|
|
|
+ //throw new BaseException("任务办理失败");
|
|
|
}
|
|
|
catch (Exception e) {
|
|
|
Throwable t = e.getCause();//org.activiti.engine.ActivitiException
|