feat(flow): 回调信封升级——事件携带操作人身份(operatorUserId/operatorName)
在飞工作合入:FlowEvent 增操作人字段(可空),引擎/推进监听/回调派发全程透传, 对齐 SDK FlowCallbackEvent 的 taskId/operator 字段(规范 §6.4)。
This commit is contained in:
@@ -142,7 +142,8 @@ public class FlowInstanceService {
|
||||
FlwEnums.TaskStatus.WITHDRAWN, instance.getSubmitterId(), instance.getSubmitterName());
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("result", "WITHDRAWN");
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.WITHDRAWN, instanceId, null, data));
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.WITHDRAWN, instanceId, null,
|
||||
instance.getSubmitterId(), instance.getSubmitterName(), data));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,7 +231,8 @@ public class FlowInstanceService {
|
||||
FlowDefModel model = flowEngine.parseModel(requireDef(instance.getDefId()));
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("nodeSummary", FlowEngine.nodeSummary(model));
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.SUBMITTED, instance.getId(), null, data));
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.SUBMITTED, instance.getId(), null,
|
||||
instance.getSubmitterId(), instance.getSubmitterName(), data));
|
||||
}
|
||||
|
||||
/** 代发起结果值对象 */
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.yunhai.flowcenter.engine.BranchScope;
|
||||
import com.yunhai.flowcenter.engine.FlowDefModel;
|
||||
import com.yunhai.flowcenter.engine.FlowEvent;
|
||||
import com.yunhai.flowcenter.engine.FlowEngine;
|
||||
import com.yunhai.flowcenter.engine.FlowOperator;
|
||||
import com.yunhai.flowcenter.entity.FlwDef;
|
||||
import com.yunhai.flowcenter.entity.FlwInstance;
|
||||
import com.yunhai.flowcenter.entity.FlwTask;
|
||||
@@ -97,7 +98,7 @@ public class FlowTaskService {
|
||||
data.put("edgeName", chosenEdge);
|
||||
}
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.TASK_HANDLED,
|
||||
instance.getId(), taskId, data));
|
||||
instance.getId(), taskId, task.getAssigneeId(), task.getAssigneeName(), data));
|
||||
if (!approved) {
|
||||
rejectFlow(instance, task, opinion);
|
||||
} else if (FlowDefModel.COUNTERSIGN_ANY.equals(countersignOf(task))) {
|
||||
@@ -163,7 +164,7 @@ public class FlowTaskService {
|
||||
data.put("rejectTaskId", task.getId());
|
||||
data.put("opinion", opinion);
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.REJECTED,
|
||||
instance.getId(), task.getId(), data));
|
||||
instance.getId(), task.getId(), task.getAssigneeId(), task.getAssigneeName(), data));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +200,8 @@ public class FlowTaskService {
|
||||
throw new BizException(ErrorCode.PARAM_ERROR, "任务已被办理或已失效,请刷新");
|
||||
}
|
||||
taskRepository.invalidatePendingByNode(instance.getId(), task.getNodeId());
|
||||
flowEngine.returnTo(instance, def, task.getNodeId(), target);
|
||||
flowEngine.returnTo(instance, def, task.getNodeId(), target,
|
||||
FlowOperator.of(task.getAssigneeId(), task.getAssigneeName()));
|
||||
instanceRepository.save(instance);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
@@ -291,7 +293,7 @@ public class FlowTaskService {
|
||||
data.put("opinion", reason);
|
||||
}
|
||||
eventPublisher.publishEvent(FlowEvent.of(FlowEvent.Type.TRANSFERRED,
|
||||
instance.getId(), newTask.getId(), data));
|
||||
instance.getId(), newTask.getId(), task.getAssigneeId(), task.getAssigneeName(), data));
|
||||
}
|
||||
|
||||
/** 待办任务守卫:存在、本校、本人办理、仍待办 */
|
||||
|
||||
Reference in New Issue
Block a user