Merge branch 'refs/heads/REQ-2324' into feature/merged_all_req

This commit is contained in:
wangli 2024-05-22 14:12:47 +08:00
commit db96510adc
2 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.task.api.Task;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.util.List;
@ -56,8 +57,10 @@ public class CustomCompleteDummyTaskCmd implements Command<Void>, Serializable {
if (Objects.isNull(task)) {
throw new WorkflowEngineException(DUMMY_TASK_NOT_EXISTS, processInstanceId, taskId);
}
task.setName(flowNodeName);
taskService.saveTask(task);
if (StringUtils.hasText(flowNodeName)) {
task.setName(flowNodeName);
taskService.saveTask(task);
}
Authentication.setAuthenticatedUserId("system");
CustomTaskHelper.addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, operationDesc);

View File

@ -655,7 +655,8 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
public void completeRobotTask(BpmnRobotTaskCompleteDTO dto) {
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
commandExecutor.execute(new CustomCompleteDummyTaskCmd(dto.getProcessInstanceId(), dto.getTaskId(),
dto.getRobotNode().getFlowNodeName(), dto.getRobotNode().getOperationDesc(), extAxHiTaskInstService));
Objects.isNull(dto.getRobotNode()) ? null : dto.getRobotNode().getFlowNodeName(),
dto.getRobotNode().getOperationDesc(), extAxHiTaskInstService));
}
@Override