update 调整自定义任务
This commit is contained in:
parent
26e149a357
commit
c859fa4c38
@ -1,6 +1,5 @@
|
|||||||
package org.dromara.workflow.flowable.strategy;
|
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
|
* @param businessKey 业务id
|
||||||
*/
|
*/
|
||||||
void handleTask(Task task, String businessKey);
|
void handleTask(String taskId, String businessKey);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package org.dromara.workflow.listener;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.workflow.annotation.FlowListenerAnnotation;
|
import org.dromara.workflow.annotation.FlowListenerAnnotation;
|
||||||
import org.dromara.workflow.flowable.strategy.FlowTaskEventHandler;
|
import org.dromara.workflow.flowable.strategy.FlowTaskEventHandler;
|
||||||
import org.flowable.task.api.Task;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,7 +17,7 @@ import org.springframework.stereotype.Component;
|
|||||||
public class TestCustomTaskHandler implements FlowTaskEventHandler {
|
public class TestCustomTaskHandler implements FlowTaskEventHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleTask(Task task, String businessKey) {
|
public void handleTask(String taskId, String businessKey) {
|
||||||
log.info("任务名称:" + task.getName() + ",业务ID:" + businessKey);
|
log.info("任务ID:" + taskId + ",业务ID:" + businessKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
String key = processInstance.getProcessDefinitionKey() + "_" + task.getTaskDefinitionKey();
|
String key = processInstance.getProcessDefinitionKey() + "_" + task.getTaskDefinitionKey();
|
||||||
FlowTaskEventHandler taskHandler = flowEventStrategy.getTaskHandler(key);
|
FlowTaskEventHandler taskHandler = flowEventStrategy.getTaskHandler(key);
|
||||||
if (taskHandler != null) {
|
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());
|
taskService.addComment(completeTaskBo.getTaskId(), task.getProcessInstanceId(), TaskStatusEnum.PASS.getStatus(), StringUtils.isBlank(completeTaskBo.getMessage()) ? "同意" : completeTaskBo.getMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user