增加文档、视频教程的地址
This commit is contained in:
parent
b0cdfd7afc
commit
907c7e763f
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener;
|
package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService;
|
import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService;
|
||||||
@ -16,6 +17,7 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,15 +65,18 @@ public class BpmTaskEventListener extends AbstractFlowableEngineEventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void activityCancelled(FlowableActivityCancelledEvent event) {
|
protected void activityCancelled(FlowableActivityCancelledEvent event) {
|
||||||
HistoricActivityInstance activity = activityService.getHistoricActivityByExecutionId(event.getActivityId());
|
List<HistoricActivityInstance> activityList = activityService.getHistoricActivityListByExecutionId(event.getExecutionId());
|
||||||
if (activity == null) {
|
if (CollUtil.isEmpty(activityList)) {
|
||||||
log.error("[activityCancelled][使用 executionId({}) 查找不到对应的活动实例]", event.getExecutionId());
|
log.error("[activityCancelled][使用 executionId({}) 查找不到对应的活动实例]", event.getExecutionId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(activity.getTaskId())) {
|
// 遍历处理
|
||||||
return;
|
activityList.forEach(activity -> {
|
||||||
}
|
if (StrUtil.isEmpty(activity.getTaskId())) {
|
||||||
taskService.updateTaskExtCancel(activity.getTaskId());
|
return;
|
||||||
|
}
|
||||||
|
taskService.updateTaskExtCancel(activity.getTaskId());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,6 @@ public interface BpmActivityService {
|
|||||||
* @param executionId 执行编号
|
* @param executionId 执行编号
|
||||||
* @return 活动实例
|
* @return 活动实例
|
||||||
*/
|
*/
|
||||||
HistoricActivityInstance getHistoricActivityByExecutionId(String executionId);
|
List<HistoricActivityInstance> getHistoricActivityListByExecutionId(String executionId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,8 @@ public class BpmActivityServiceImpl implements BpmActivityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HistoricActivityInstance getHistoricActivityByExecutionId(String executionId) {
|
public List<HistoricActivityInstance> getHistoricActivityListByExecutionId(String executionId) {
|
||||||
return historyService.createHistoricActivityInstanceQuery().executionId(executionId).singleResult();
|
return historyService.createHistoricActivityInstanceQuery().executionId(executionId).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user