update - 完善虚拟机器人节点的完成时,重新分配给原审批人
This commit is contained in:
parent
36b9e86ae6
commit
5a591e44fa
@ -8,6 +8,7 @@ import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -66,11 +67,17 @@ public class CustomCompleteDummyTaskCmd implements Command<Void>, Serializable {
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
return;
|
||||
}
|
||||
List<HistoricTaskInstanceEntity> inCache =
|
||||
CommandContextUtil.getEntityCache().findInCache(HistoricTaskInstanceEntity.class);
|
||||
taskList.stream().filter(i -> !Objects.equals(i.getTaskDefinitionKey(), DUMMY_ID))
|
||||
.filter(i -> Objects.nonNull(i.getOwner()))
|
||||
.forEach(i -> {
|
||||
i.setOwner(null);
|
||||
i.setAssignee(i.getOwner());
|
||||
i.setOwner(null);
|
||||
inCache.stream().filter(cache -> Objects.equals(cache.getId(), i.getId())).findFirst().ifPresent(j -> {
|
||||
j.setAssignee(i.getOwner());
|
||||
j.setOwner(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,18 +100,17 @@ public class CustomCreateDummyTaskCmd implements Command<String>, Serializable {
|
||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||
TaskService taskService = processEngineConfiguration.getTaskService();
|
||||
List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstanceId).active().list();
|
||||
List<HistoricTaskInstanceEntity> inCache =
|
||||
CommandContextUtil.getEntityCache().findInCache(HistoricTaskInstanceEntity.class);
|
||||
if (!CollectionUtils.isEmpty(taskList)) {
|
||||
taskList.forEach(i -> {
|
||||
i.setOwner(i.getAssignee());
|
||||
i.setAssignee(HIDDEN_ASSIGNEE_ID);
|
||||
inCache.stream().filter(cache -> Objects.equals(cache.getId(), i.getId())).findFirst().ifPresent(j -> {
|
||||
j.setOwner(j.getAssignee());
|
||||
j.setAssignee(HIDDEN_ASSIGNEE_ID);
|
||||
});
|
||||
});
|
||||
|
||||
// CustomTaskHelper.addMultiTask(commandContext, (TaskEntity) taskList.get(0), assigner);
|
||||
//
|
||||
// taskList.stream().filter(i -> !Objects.equals(i.getTaskDefinitionKey(), DUMMY_ID)).forEach
|
||||
// (task -> {
|
||||
// CustomTaskHelper.deleteMultiTask(commandContext, (TaskEntity) task);
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user