Skip to content

Commit

Permalink
优化唤醒逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
qmdx committed Aug 21, 2024
1 parent 46e24c8 commit 2f7321a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,4 @@ 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 @@ -175,6 +175,21 @@ protected static FlwTaskActor of(String tenantId, String actorId, String actorNa
return taskActor;
}

public static FlwTaskActor ofFlwHisTaskActor(Long taskId, FlwHisTaskActor hta) {
FlwTaskActor taskActor = new FlwTaskActor();
taskActor.setTenantId(hta.getTenantId());
taskActor.setInstanceId(hta.getInstanceId());
taskActor.setTaskId(taskId);
taskActor.setActorId(hta.getActorId());
taskActor.setActorName(hta.getActorName());
taskActor.setActorType(hta.getActorType());
taskActor.setWeight(hta.getWeight());
taskActor.setAgentId(hta.getAgentId());
taskActor.setAgentType(hta.getAgentType());
taskActor.setExtend(hta.getExtend());
return taskActor;
}

public void setExtendOf(Object object) {
this.extend = FlowLongContext.toJson(object);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,7 @@ public FlwTask resume(Long taskId, FlowCreator flowCreator) {

// 历史任务参与者恢复
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));
hisTaskActors.forEach(t -> taskActorDao.insert(FlwTaskActor.ofFlwHisTaskActor(flwTask.getId(), t)));

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

0 comments on commit 2f7321a

Please sign in to comment.