Skip to content

Commit

Permalink
!128 唤醒任务时调用报错
Browse files Browse the repository at this point in the history
Merge pull request !128 from Lee Cooper/dev_adapter
  • Loading branch information
qmdx authored and gitee-org committed Aug 21, 2024
2 parents b9cc4ac + 65f3c9d commit 46e24c8
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 46e24c8

Please sign in to comment.