update - 调整工作流内部的一些关于人的逻辑

This commit is contained in:
wangli 2023-10-08 18:18:47 +08:00
parent 078cdf6045
commit f3c1bcfe1f

View File

@ -14,7 +14,7 @@ import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATI
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
/**
* 自定义实现的流程监听器, 实现了 Ordered 接口
* 任务节点关联的处理人快照保持
* <p>
* 注意:Order 值越小,优先级越高
*
@ -23,7 +23,7 @@ import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATI
*/
@Slf4j
@Component
public class CustomBpmTaskTaskEventListener implements BpmTaskEventListener {
public class SnapshotBpmTaskTaskEventListener implements BpmTaskEventListener {
@Override
public void onAssigned(DelegateTask delegateTask) {
@ -33,12 +33,10 @@ public class CustomBpmTaskTaskEventListener implements BpmTaskEventListener {
return;
}
// identityId_identityType
String assignee = delegateTask.getAssignee();
assignerList.stream().filter(i -> Objects.equals(assignee, i.buildAssigneeId())).findFirst().ifPresent(i -> {
assignerList.stream().filter(i -> Objects.equals(delegateTask.getAssignee(), i.buildAssigneeId())).findFirst().ifPresent(i -> {
// 保存每个 taskId 的审批人
delegateTask.setVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT + delegateTask.getId(), i);
});
log.info("task assigned...");
}
@Override