Skip to content

Commit

Permalink
fix: 唤醒历史任务时从历史任务中恢复对应的历史任务参与者列表
Browse files Browse the repository at this point in the history
修复bug:唤醒任务时,在分配任务时使用的taskId为克隆前的taskId,应该使用克隆后的taskId
  • Loading branch information
20162430413 committed Aug 21, 2024
1 parent e41a345 commit 65f3c9d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,19 @@ public static FlwHisTaskActor of(FlwTaskActor taskActor) {
his.setExtend(taskActor.getExtend());
return his;
}

public FlwHisTaskActor cloneTask() {
FlwHisTaskActor his = new FlwHisTaskActor();
his.setTenantId(this.getTenantId());
his.setInstanceId(this.getInstanceId());
his.setTaskId(this.getTaskId());
his.setActorId(this.getActorId());
his.setActorName(this.getActorName());
his.setWeight(this.getWeight());
his.setActorType(this.getActorType());
his.setAgentId(this.getAgentId());
his.setAgentType(this.getAgentType());
his.setExtend(this.getExtend());
return his;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,16 @@ public FlwTask resume(Long taskId, FlowCreator flowCreator) {
FlwTask flwTask = histTask.cloneTask(null);
taskDao.insert(flwTask);

// 历史任务参与者恢复
List<FlwHisTaskActor> hisTaskActors = hisTaskActorDao.selectListByTaskId(taskId);
hisTaskActors.forEach(t -> {
FlwHisTaskActor his = t.cloneTask();
his.setTaskId(flwTask.getId());
taskActorDao.insert((FlwTaskActor) his);
});

// 分配任务
assignTask(flwTask.getInstanceId(), taskId, 0, FlwTaskActor.of(flowCreator, flwTask));
// assignTask(flwTask.getInstanceId(), taskId, 0, FlwTaskActor.of(flowCreator, flwTask));

// 更新当前执行节点信息
this.updateCurrentNode(flwTask);
Expand Down

0 comments on commit 65f3c9d

Please sign in to comment.