update 调整自定义任务

This commit is contained in:
songgaoshuai 2024-03-29 15:59:48 +08:00
parent 26e149a357
commit c859fa4c38
3 changed files with 5 additions and 7 deletions

View File

@ -1,6 +1,5 @@
package org.dromara.workflow.flowable.strategy;
import org.flowable.task.api.Task;
/**
* 流程任务监听
@ -13,8 +12,8 @@ public interface FlowTaskEventHandler {
/**
* 执行办理任务监听
*
* @param task 任务
* @param taskId 任务ID
* @param businessKey 业务id
*/
void handleTask(Task task, String businessKey);
void handleTask(String taskId, String businessKey);
}

View File

@ -3,7 +3,6 @@ package org.dromara.workflow.listener;
import lombok.extern.slf4j.Slf4j;
import org.dromara.workflow.annotation.FlowListenerAnnotation;
import org.dromara.workflow.flowable.strategy.FlowTaskEventHandler;
import org.flowable.task.api.Task;
import org.springframework.stereotype.Component;
/**
@ -18,7 +17,7 @@ import org.springframework.stereotype.Component;
public class TestCustomTaskHandler implements FlowTaskEventHandler {
@Override
public void handleTask(Task task, String businessKey) {
log.info("任务名称:" + task.getName() + ",业务ID:" + businessKey);
public void handleTask(String taskId, String businessKey) {
log.info("任务ID:" + taskId + ",业务ID:" + businessKey);
}
}

View File

@ -187,7 +187,7 @@ public class ActTaskServiceImpl implements IActTaskService {
String key = processInstance.getProcessDefinitionKey() + "_" + task.getTaskDefinitionKey();
FlowTaskEventHandler taskHandler = flowEventStrategy.getTaskHandler(key);
if (taskHandler != null) {
taskHandler.handleTask(task, processInstance.getBusinessKey());
taskHandler.handleTask(task.getId(), processInstance.getBusinessKey());
}
//办理意见
taskService.addComment(completeTaskBo.getTaskId(), task.getProcessInstanceId(), TaskStatusEnum.PASS.getStatus(), StringUtils.isBlank(completeTaskBo.getMessage()) ? "同意" : completeTaskBo.getMessage());