feat(flow): 回调信封升级——事件携带操作人身份(operatorUserId/operatorName)

在飞工作合入:FlowEvent 增操作人字段(可空),引擎/推进监听/回调派发全程透传,
对齐 SDK FlowCallbackEvent 的 taskId/operator 字段(规范 §6.4)。
This commit is contained in:
chenxing
2026-09-22 16:54:02 +08:00
parent 695e20ab52
commit d2395c20ce
9 changed files with 102 additions and 32 deletions
@@ -59,14 +59,24 @@ public class FlowEvent {
private final Long instanceId;
/** 任务事件带 taskId(SUBMITTED 等办件级事件为 null) */
private final Long taskId;
/** 操作人 id(谁导致本事件;回调信封提升为 operatorUserId)。可空:语义见《子应用接入流程中心规范.md》§6.4 */
private final Integer operatorId;
/** 操作人姓名快照。可空 */
private final String operatorName;
/** 事件明细(result/opinion/rejectNode/task.created 的 n/m 等),可为空 */
private final Map<String, Object> data;
public static FlowEvent of(Type type, Long instanceId) {
return new FlowEvent(type, instanceId, null, new HashMap<>());
return new FlowEvent(type, instanceId, null, null, null, new HashMap<>());
}
public static FlowEvent of(Type type, Long instanceId, Long taskId, Map<String, Object> data) {
return new FlowEvent(type, instanceId, taskId, data == null ? new HashMap<>() : data);
return new FlowEvent(type, instanceId, taskId, null, null, data == null ? new HashMap<>() : data);
}
public static FlowEvent of(Type type, Long instanceId, Long taskId,
Integer operatorId, String operatorName, Map<String, Object> data) {
return new FlowEvent(type, instanceId, taskId, operatorId, operatorName,
data == null ? new HashMap<>() : data);
}
}