Commit 9d273089 authored by 赵啸非's avatar 赵啸非

修改部分pom

parent eb902629
package com.mortals.flowable.listener;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.FormService;
......@@ -18,7 +19,7 @@ import java.util.Map;
* @description:
**/
//@Component
@CommonsLog
@Slf4j
public class ProcessInstanceCompleteListener extends AbstractFlowableEngineEventListener {
@Autowired
......
package com.mortals.flowable.listener;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.FormService;
......@@ -19,7 +20,7 @@ import java.util.Map;
* @description:
**/
//@Component
@CommonsLog
@Slf4j
public class ProcessInstanceStartListener extends AbstractFlowableEngineEventListener {
@Autowired
private TaskService taskService;
......
......@@ -13,6 +13,7 @@ import com.mortals.xhx.module.platform.service.PlatformListenerService;
import com.mortals.xhx.module.platform.service.PlatformModelinfoService;
import com.mortals.xhx.module.platform.service.PlatformService;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
......@@ -44,11 +45,13 @@ import java.util.stream.Collectors;
* @date: 2021/9/9 11:48
*/
@Component
@CommonsLog
@Slf4j
public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListener {
public static String TaskCreate = "2";
public static String TaskComplete = "4";
@Autowired
private TaskService taskService;
@Autowired
......@@ -63,27 +66,18 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
@Override
protected void taskCreated(FlowableEngineEntityEvent event) {
log.info("进入任务创建全局监听");
List<String> userNameList = new ArrayList<>();
FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) event;
TaskEntity taskEntity = (TaskEntity) (flowableEntityEvent).getEntity();
if (!ObjectUtils.isEmpty(taskEntity.getParentTaskId())) {
log.info("当前任务为子任务");
return;
}
String taskId = taskEntity.getId();
String scopeType = taskEntity.getScopeType();
log.info(String.format("任务类型:%s", scopeType));
String scopeId = taskEntity.getScopeId();
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(taskEntity.getProcessInstanceId()).singleResult();
if (historicProcessInstance == null) {
log.info("historicProcessInstance is null!");
return;
......@@ -94,9 +88,7 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
log.info("idList is null!");
}
log.info("idList:" + JSON.toJSONString(idList));
// 获取接收人,区分审核人,候选组,并行等 todo
idList.forEach(identityLink -> {
if (StringUtils.isNotBlank(identityLink.getUserId())) {
......@@ -162,6 +154,19 @@ public class GlobalTaskCreateListener extends AbstractFlowableEngineEventListene
@Override
protected void taskCompleted(FlowableEngineEntityEvent event) {
log.info("进入任务完成全局监听");
FlowableEntityEventImpl flowableEntityEvent = (FlowableEntityEventImpl) event;
TaskEntity taskEntity = (TaskEntity) (flowableEntityEvent).getEntity();
if (!ObjectUtils.isEmpty(taskEntity.getParentTaskId())) {
log.info("当前任务为子任务");
return;
}
// String taskId = taskEntity.getId();
// Object flowPerson = taskEntity.getVariable("flowPerson");
log.info("taskId:{},taskName:{}", taskEntity.getId(), taskEntity.getName());
super.taskCompleted(event);
}
......
......@@ -475,8 +475,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IApiFlowT
flowTask.setAttachmentList(attachmentEntities);
hisFlowList.add(flowTask);
}
//查询当前任务是否存在子任务
List<HistoricTaskInstance> subList = historyService.createHistoricTaskInstanceQuery()
.taskParentTaskId(histIns.getTaskId())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment