Compare commits
6 Commits
f62ab005c2
...
0963893950
| Author | SHA1 | Date | |
|---|---|---|---|
| 0963893950 | |||
| ae1a6fc445 | |||
| 1d0e4faff2 | |||
| e371175be6 | |||
| 7aab8ae4e2 | |||
| 067320b166 |
@ -110,4 +110,10 @@ public class SupportRefreshProperties {
|
||||
@Value("${workflow.processLogHtmlUrl:https://taskflow-web.axzo.cn/#/document/log?processInstanceId=%s&personId=%s}")
|
||||
private String processLogHtmlUrl;
|
||||
|
||||
/**
|
||||
* 需要过滤表单字段的业务 ID
|
||||
*/
|
||||
@Value("${workflow.filterFormFieldProcessDefinitionKeys:}")
|
||||
private List<String> filterFormFieldProcessDefinitionKeys;
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,12 @@ package cn.axzo.workflow.core.listener;
|
||||
|
||||
import cn.axzo.workflow.common.constant.BpmnConstants;
|
||||
import cn.axzo.workflow.core.common.context.OperationContext;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.model.SimpleFormModel;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@ -11,6 +16,7 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.azxo.framework.common.constatns.Constants.CTX_LOG_ID_MDC;
|
||||
@ -21,9 +27,17 @@ import static cn.azxo.framework.common.constatns.Constants.CTX_LOG_ID_MDC;
|
||||
* @author wangli
|
||||
* @since 2024/4/9 14:21
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AbstractBpmnEventListener<T extends OperationContext> implements OperationContext {
|
||||
|
||||
private T context;
|
||||
protected final FormRepositoryService formRepositoryService;
|
||||
private final SupportRefreshProperties refreshProperties;
|
||||
|
||||
protected AbstractBpmnEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
this.formRepositoryService = formRepositoryService;
|
||||
this.refreshProperties = refreshProperties;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@ -52,6 +66,29 @@ public abstract class AbstractBpmnEventListener<T extends OperationContext> impl
|
||||
return processDefinitionId.split(":")[0];
|
||||
}
|
||||
|
||||
protected SimpleFormModel getSimpleFormModel(String processDefinitionKey, String tenantId) {
|
||||
try {
|
||||
if (!refreshProperties.getFilterFormFieldProcessDefinitionKeys().contains(processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey, tenantId, true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> removeBpmnConstantsVariables(Map<String, Object> originVariables, String processDefinitionKey, String tenantId) {
|
||||
SimpleFormModel simpleFormModel = getSimpleFormModel(processDefinitionKey, tenantId);
|
||||
return removeBpmnConstantsVariables(originVariables, simpleFormModel.allFieldsAsMap().keySet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除一些业务不需要关心的变量
|
||||
*
|
||||
@ -66,7 +103,27 @@ public abstract class AbstractBpmnEventListener<T extends OperationContext> impl
|
||||
BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO,
|
||||
BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT,
|
||||
BpmnConstants.TASK_COMPLETE_OPERATION_TYPE,
|
||||
BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO
|
||||
BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO,
|
||||
BpmnConstants.BIZ_NODE_ALTER,
|
||||
BpmnConstants.INITIATOR_SPECIFY,
|
||||
BpmnConstants.INTERNAL_PROCESS_BIZ_TYPE,
|
||||
BpmnConstants.INTERNAL_PROCESS_AGENT,
|
||||
BpmnConstants.PROCESS_OWNERSHIP_APPLICATION,
|
||||
BpmnConstants.SIGNATURE_COLLECTION,
|
||||
BpmnConstants.INTERNAL_PROCESS_WORKSPACE_TYPE,
|
||||
BpmnConstants.WORKFLOW_ENGINE_VERSION,
|
||||
BpmnConstants.BIZ_ORG_RELATION,
|
||||
BpmnConstants.TASK_LOG_NODE_HAS_BEEN_HIDDEN,
|
||||
BpmnConstants.INTERNAL_END_USER_ID,
|
||||
BpmnConstants.INTERNAL_END_TENANT_ID,
|
||||
BpmnConstants.INTERNAL_END_USER_NAME,
|
||||
BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG,
|
||||
BpmnConstants.INTERNAL_PROCESS_TYPE_CANCEL,
|
||||
BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT,
|
||||
BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER,
|
||||
BpmnConstants.NUMBER_OF_INSTANCES,
|
||||
BpmnConstants.MULTI_INSTANCE_LOOP_COUNTER,
|
||||
BpmnConstants.CLOSE_PROCESS_ASSIGNER
|
||||
);
|
||||
if (!CollectionUtils.isEmpty(removeVariableKey)) {
|
||||
removeVariableKey.forEach(originVariables::remove);
|
||||
@ -79,4 +136,6 @@ public abstract class AbstractBpmnEventListener<T extends OperationContext> impl
|
||||
.noneMatch(prefix -> entry.getKey().startsWith(prefix)))
|
||||
.collect(HashMap::new, (m, e) -> m.put(e.getKey(), e.getValue()), HashMap::putAll);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.tx.listener.AddTimerJobTransactionListener;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnActivityEventListener;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.flowable.bpmn.model.BpmnModel;
|
||||
@ -21,10 +20,12 @@ import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_NODE_ALTER;
|
||||
@ -40,9 +41,13 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_NODE_ALTER;
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@AllArgsConstructor
|
||||
public class InternalBpmnActivityEventListener_lo_Listener extends AbstractBpmnEventListener<ActivityOperationContext> implements BpmnActivityEventListener, Ordered {
|
||||
private final SupportRefreshProperties refreshProperties;
|
||||
@Resource
|
||||
private SupportRefreshProperties refreshProperties;
|
||||
|
||||
public InternalBpmnActivityEventListener_lo_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
|
||||
@ -3,20 +3,22 @@ package cn.axzo.workflow.core.listener.impl;
|
||||
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.event.ExtTaskInstCreateEvent;
|
||||
import cn.axzo.workflow.core.engine.event.ExtTaskInstUpdateEvent;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
|
||||
@ -35,9 +37,13 @@ import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCES
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@AllArgsConstructor
|
||||
public class InternalExtAxTaskInstEvent_lo_Listener extends AbstractBpmnEventListener<TaskOperationContext> implements BpmnTaskEventListener {
|
||||
private final RuntimeService runtimeService;
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
public InternalExtAxTaskInstEvent_lo_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.axzo.workflow.common.model.dto.VariableObjectDTO;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.BpmnSignConf;
|
||||
import cn.axzo.workflow.core.common.context.ActivityOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnActivityEventListener;
|
||||
import cn.axzo.workflow.core.repository.entity.ExtAxProcessSign;
|
||||
@ -17,6 +18,7 @@ import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -43,6 +45,10 @@ public class OperationFileArchiveActivityEvent_101_Listener extends AbstractBpmn
|
||||
@Resource
|
||||
private WpsUtil wpsUtil;
|
||||
|
||||
public OperationFileArchiveActivityEvent_101_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 101;
|
||||
|
||||
@ -8,6 +8,7 @@ import cn.axzo.workflow.common.model.request.bpmn.task.ExtHiTaskSearchDTO;
|
||||
import cn.axzo.workflow.common.model.response.mq.ProcessActivityDTO;
|
||||
import cn.axzo.workflow.core.common.context.ActivityOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.event.BizCallbackEvent;
|
||||
import cn.axzo.workflow.core.engine.event.BizSpecifyAssigneeEvent;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
@ -20,9 +21,7 @@ import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.model.SimpleFormModel;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -73,8 +72,10 @@ public class RocketMqBpmActivityEvent_100_Listener extends AbstractBpmnEventList
|
||||
private EventProducer<?> eventProducer;
|
||||
@Value("${sendMq:true}")
|
||||
private Boolean sendMQ;
|
||||
@Resource
|
||||
private FormRepositoryService formRepositoryService;
|
||||
|
||||
public RocketMqBpmActivityEvent_100_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(DelegateExecution execution) {
|
||||
@ -180,29 +181,11 @@ public class RocketMqBpmActivityEvent_100_Listener extends AbstractBpmnEventList
|
||||
ProcessInstance processInstance = getContext().getProcessInstance(() ->
|
||||
runtimeService.createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId())
|
||||
.includeProcessVariables().singleResult());
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
if (!Objects.equals("gongrendanganqianshu", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("jinengpeixun", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("anquanjiaoyu", processInstance.getProcessDefinitionKey())) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processInstance.getProcessDefinitionKey(), processInstance.getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
|
||||
if (Objects.nonNull(processInstance)) {
|
||||
dto.setProcessDefinitionKey(processInstance.getProcessDefinitionKey());
|
||||
dto.setBusinessKey(processInstance.getBusinessKey());
|
||||
dto.setVariables(removeBpmnConstantsVariables(processInstance.getProcessVariables(), formModel.allFieldsAsMap().keySet()));
|
||||
dto.setVariables(removeBpmnConstantsVariables(processInstance.getProcessVariables(), processInstance.getProcessDefinitionKey(), processInstance.getTenantId()));
|
||||
dto.setWorkflowEngineVersion(String.valueOf(processInstance.getProcessVariables()
|
||||
.getOrDefault(WORKFLOW_ENGINE_VERSION, FLOW_SERVER_VERSION_121)));
|
||||
} else {
|
||||
|
||||
@ -11,6 +11,7 @@ import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstanceVO
|
||||
import cn.axzo.workflow.common.model.response.mq.MessagePushDTO;
|
||||
import cn.axzo.workflow.core.common.context.NoticeOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEvent;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventImpl;
|
||||
@ -19,7 +20,6 @@ import cn.axzo.workflow.core.listener.BpmnMessagePushEventListener;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
|
||||
import cn.axzo.workflow.core.service.converter.BpmnHistoricTaskInstanceConverter;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.engine.HistoryService;
|
||||
@ -27,9 +27,7 @@ import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.model.SimpleFormModel;
|
||||
import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -44,38 +42,17 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_ORG_RELATION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CLOSE_PROCESS_ASSIGNER;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.CREATE_INSTANCE_PARAMS;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INITIATOR_SPECIFY;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_TENANT_ID;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_ID;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_AGENT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_BIZ_TYPE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_CANCEL;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_WORKSPACE_TYPE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.MQ_ASSIGNER_BATCH_SIZE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.MQ_OWNERSHIP_APPLICATION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.MQ_OWNERSHIP_PROCESS_DEFINITION_KEY;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.MULTI_INSTANCE_LOOP_COUNTER;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.NUMBER_OF_INSTANCES;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.PROCESS_OWNERSHIP_APPLICATION;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.SUPPORT_UPGRADE_VARIABLE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.WORKFLOW_ENGINE_VERSION;
|
||||
import static cn.axzo.workflow.common.constant.VariableConstants.VAR_ACTIVITY_ID;
|
||||
import static cn.axzo.workflow.common.constant.VariableConstants.VAR_ACTIVITY_NAME;
|
||||
import static cn.axzo.workflow.common.constant.VariableConstants.VAR_BUSINESS_KEY;
|
||||
@ -131,34 +108,11 @@ public class RocketMqMessagePushEventListener extends AbstractBpmnEventListener<
|
||||
private String serviceVersion;
|
||||
@Value("${workflow.noticeTemplateCode}")
|
||||
private String noticeTemplateCode;
|
||||
@Resource
|
||||
private FormRepositoryService formRepositoryService;
|
||||
|
||||
private static final List<String> REMOVE_KEYS = Lists.newArrayList(
|
||||
INTERNAL_INITIATOR,
|
||||
INTERNAL_END_USER_ID,
|
||||
INTERNAL_END_TENANT_ID,
|
||||
INTERNAL_END_USER_NAME,
|
||||
INTERNAL_DELETE_PROCESS_FLAG,
|
||||
INTERNAL_PROCESS_TYPE_CANCEL,
|
||||
INTERNAL_PROCESS_TYPE_REJECT,
|
||||
INTERNAL_SPECIFY_NEXT_APPROVER,
|
||||
BIZ_ORG_RELATION,
|
||||
INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO,
|
||||
INTERNAL_TASK_RELATION_ASSIGNEE_INFO,
|
||||
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT,
|
||||
NUMBER_OF_INSTANCES,
|
||||
MULTI_INSTANCE_LOOP_COUNTER,
|
||||
TASK_COMPLETE_OPERATION_TYPE,
|
||||
INITIATOR_SPECIFY,
|
||||
INTERNAL_PROCESS_BIZ_TYPE,
|
||||
INTERNAL_PROCESS_AGENT,
|
||||
PROCESS_OWNERSHIP_APPLICATION,
|
||||
INTERNAL_PROCESS_WORKSPACE_TYPE,
|
||||
CLOSE_PROCESS_ASSIGNER,
|
||||
CREATE_INSTANCE_PARAMS,
|
||||
WORKFLOW_ENGINE_VERSION
|
||||
);
|
||||
|
||||
public RocketMqMessagePushEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotice(MessagePushEvent event) {
|
||||
@ -442,43 +396,8 @@ public class RocketMqMessagePushEventListener extends AbstractBpmnEventListener<
|
||||
}
|
||||
}
|
||||
|
||||
// 传递业务的参数
|
||||
REMOVE_KEYS.forEach(originVariables::remove);
|
||||
log.info("流程实例的参数: {}", JSONUtil.toJsonStr(originVariables));
|
||||
if (CollectionUtils.isEmpty(originVariables)) {
|
||||
return variables;
|
||||
}
|
||||
Iterator<Map.Entry<String, Object>> iterator = originVariables.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, Object> entry = iterator.next();
|
||||
REMOVE_KEYS.forEach(key -> {
|
||||
if (entry.getKey().contains(key)) {
|
||||
iterator.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
if (!Objects.equals("gongrendanganqianshu", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("jinengpeixun", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("anquanjiaoyu", processInstance.getProcessDefinitionKey())) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processInstance.getProcessDefinitionKey(), processInstance.getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
variables.putAll(removeBpmnConstantsVariables(originVariables, processInstance.getProcessDefinitionKey(), processInstance.getTenantId()));
|
||||
|
||||
formModel.allFieldsAsMap().keySet().forEach(originVariables::remove);
|
||||
|
||||
variables.putAll(originVariables);
|
||||
return variables;
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import cn.axzo.workflow.common.model.request.bpmn.BpmnSignConf;
|
||||
import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
|
||||
import cn.axzo.workflow.core.common.context.ProcessOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
|
||||
import cn.axzo.workflow.core.repository.entity.ExtAxDocContent;
|
||||
@ -26,7 +27,7 @@ import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -49,7 +50,6 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.BPM_MODEL_CATEGORY;
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@RefreshScope
|
||||
public class FileArchiveProcessEventListener extends AbstractBpmnEventListener<ProcessOperationContext> implements BpmnProcessEventListener, Ordered {
|
||||
@Resource
|
||||
private HistoryService historyService;
|
||||
@ -64,6 +64,10 @@ public class FileArchiveProcessEventListener extends AbstractBpmnEventListener<P
|
||||
@Resource
|
||||
private WpsUtil wpsUtil;
|
||||
|
||||
public FileArchiveProcessEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCompleted(FlowableEngineEntityEvent event) {
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.axzo.workflow.server.controller.listener.process;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.BpmnNoticeConf;
|
||||
import cn.axzo.workflow.core.common.context.ProcessOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventBuilder;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventImpl;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventType;
|
||||
@ -17,8 +18,8 @@ import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -36,10 +37,14 @@ import java.util.Optional;
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@RefreshScope
|
||||
public class MessagePushProcessEventListener extends AbstractBpmnEventListener<ProcessOperationContext> implements BpmnProcessEventListener, Ordered {
|
||||
@Value("${workflow.carbonCopyTemplateCode}")
|
||||
private String carbonCopyTemplateCode;
|
||||
|
||||
public MessagePushProcessEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelled(FlowableCancelledEvent event) {
|
||||
log.info("MessagePushProcessEventListener#onCancelled...processInstanceId:{}", event.getProcessInstanceId());
|
||||
|
||||
@ -7,6 +7,7 @@ import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.common.model.response.mq.ProcessInstanceDTO;
|
||||
import cn.axzo.workflow.core.common.context.ProcessOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -19,9 +20,7 @@ import org.flowable.engine.delegate.event.FlowableProcessStartedEvent;
|
||||
import org.flowable.engine.delegate.event.impl.FlowableProcessCancelledEventImpl;
|
||||
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.model.SimpleFormModel;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -67,8 +66,10 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
private RepositoryService repositoryService;
|
||||
@Value("${sendMq:true}")
|
||||
private Boolean sendMQ;
|
||||
@Resource
|
||||
private FormRepositoryService formRepositoryService;
|
||||
|
||||
public RocketMqBpmnProcessEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(FlowableEngineEntityEvent event) {
|
||||
@ -77,26 +78,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.deploymentId(((ExecutionEntityImpl) event.getEntity()).getDeploymentId()).singleResult());
|
||||
Process mainProcess = getContext().getProcess(() -> repositoryService.getBpmnModel(event.getProcessDefinitionId()).getMainProcess());
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((ExecutionEntityImpl) event.getEntity()).getVariable(INTERNAL_INITIATOR)));
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((ExecutionEntityImpl) event.getEntity()).getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_CREATED)
|
||||
.setCategory(deployment.getKey())
|
||||
@ -106,7 +87,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setProcessDefinitionKey(((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey())
|
||||
.setProcessDefinitionVersion(((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionVersion())
|
||||
.setInitiator(initiator)
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey(), ((ExecutionEntityImpl) event.getEntity()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) event.getEntity()).getStartTime())
|
||||
.setTenantId(((ExecutionEntityImpl) event.getEntity()).getTenantId())
|
||||
.setBusinessKey(((ExecutionEntityImpl) event.getEntity()).getBusinessKey())
|
||||
@ -133,26 +114,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((ExecutionEntityImpl) event.getEntity())
|
||||
.getVariable(INTERNAL_INITIATOR)));
|
||||
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((ExecutionEntityImpl) event.getEntity()).getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_STARTED)
|
||||
.setCategory(deployment.getKey())
|
||||
@ -162,7 +123,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setProcessDefinitionKey(((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey())
|
||||
.setProcessDefinitionVersion(((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionVersion())
|
||||
.setInitiator(initiator)
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey(), ((ExecutionEntityImpl) event.getEntity()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) event.getEntity()).getStartTime())
|
||||
.setTenantId(((ExecutionEntityImpl) event.getEntity()).getTenantId())
|
||||
.setBusinessKey(((ExecutionEntityImpl) event.getEntity()).getProcessInstance().getBusinessKey())
|
||||
@ -184,26 +145,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
Process mainProcess = getContext().getProcess(() -> repositoryService.getBpmnModel(event.getProcessDefinitionId()).getMainProcess());
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((FlowableProcessCancelledEventImpl) event)
|
||||
.getExecution().getVariable(INTERNAL_INITIATOR)));
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_CANCELLED)
|
||||
@ -216,7 +157,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setInitiator(initiator)
|
||||
.setLastOperationAssigner(getContext().getLastOperationAssigner(() -> BpmnTaskDelegateAssigner.toObjectCompatible(
|
||||
runtimeService.getVariable(event.getProcessInstanceId(), CLOSE_PROCESS_ASSIGNER, BpmnTaskDelegateAssigner.class))))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getStartTime())
|
||||
.setTenantId(((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId())
|
||||
.setBusinessKey(((FlowableProcessCancelledEventImpl) event).getExecution().getProcessInstanceBusinessKey())
|
||||
@ -246,26 +187,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((FlowableProcessCancelledEventImpl) event)
|
||||
.getExecution().getVariable(INTERNAL_INITIATOR)));
|
||||
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_REJECTED)
|
||||
.setCategory(deployment.getKey())
|
||||
@ -277,7 +198,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setInitiator(initiator)
|
||||
.setLastOperationAssigner(getContext().getLastOperationAssigner(() -> BpmnTaskDelegateAssigner.toObjectCompatible(
|
||||
runtimeService.getVariable(event.getProcessInstanceId(), CLOSE_PROCESS_ASSIGNER, BpmnTaskDelegateAssigner.class))))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getStartTime())
|
||||
.setTenantId(((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId())
|
||||
.setBusinessKey(((FlowableProcessCancelledEventImpl) event).getExecution().getProcessInstanceBusinessKey())
|
||||
@ -302,26 +223,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((FlowableProcessCancelledEventImpl) event)
|
||||
.getExecution().getVariable(INTERNAL_INITIATOR)));
|
||||
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_ABORTED)
|
||||
.setCategory(deployment.getKey())
|
||||
@ -333,7 +234,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setInitiator(initiator)
|
||||
.setLastOperationAssigner(getContext().getLastOperationAssigner(() -> BpmnTaskDelegateAssigner.toObjectCompatible(
|
||||
runtimeService.getVariable(event.getProcessInstanceId(), CLOSE_PROCESS_ASSIGNER, BpmnTaskDelegateAssigner.class))))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((FlowableProcessCancelledEventImpl) event).getExecution().getVariables(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getProcessDefinitionKey(), ((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) ((FlowableProcessCancelledEventImpl) event).getExecution()).getStartTime())
|
||||
.setTenantId(((FlowableProcessCancelledEventImpl) event).getExecution().getTenantId())
|
||||
.setBusinessKey(((FlowableProcessCancelledEventImpl) event).getExecution().getProcessInstanceBusinessKey())
|
||||
@ -358,26 +259,6 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
BpmnTaskDelegateAssigner initiator = getContext().getInitiator(() -> BpmnTaskDelegateAssigner.toObjectCompatible(((ExecutionEntityImpl) event.getEntity())
|
||||
.getVariable(INTERNAL_INITIATOR)));
|
||||
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
String processDefinitionKey = ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey();
|
||||
if (!Objects.equals("gongrendanganqianshu", processDefinitionKey) &&
|
||||
!Objects.equals("jinengpeixun", processDefinitionKey) &&
|
||||
!Objects.equals("anquanjiaoyu", processDefinitionKey)) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processDefinitionKey,
|
||||
((ExecutionEntityImpl) event.getEntity()).getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
ProcessInstanceDTO dto = new ProcessInstanceDTO()
|
||||
.setType(PROCESS_INSTANCE_COMPLETED)
|
||||
.setCategory(deployment.getKey())
|
||||
@ -389,7 +270,7 @@ public class RocketMqBpmnProcessEventListener extends AbstractBpmnEventListener<
|
||||
.setInitiator(initiator)
|
||||
.setLastOperationAssigner(getContext().getLastOperationAssigner(() -> BpmnTaskDelegateAssigner.toObjectCompatible(
|
||||
runtimeService.getVariable(event.getProcessInstanceId(), CLOSE_PROCESS_ASSIGNER, BpmnTaskDelegateAssigner.class))))
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(((ExecutionEntityImpl) event.getEntity()).getVariables(), ((ExecutionEntityImpl) event.getEntity()).getProcessDefinitionKey(), ((ExecutionEntityImpl) event.getEntity()).getTenantId()))
|
||||
.setStartTime(((ExecutionEntityImpl) event.getEntity()).getStartTime())
|
||||
.setTenantId(((ExecutionEntityImpl) event.getEntity()).getTenantId())
|
||||
.setBusinessKey(((ExecutionEntityImpl) event.getEntity()).getProcessInstanceBusinessKey())
|
||||
|
||||
@ -4,11 +4,13 @@ import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventProducer;
|
||||
import cn.axzo.workflow.common.enums.ElasticSearchEventEnum;
|
||||
import cn.axzo.workflow.core.common.context.ProcessOperationContext;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
|
||||
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -31,6 +33,10 @@ public class SyncToEsProcessEventListener extends AbstractBpmnEventListener<Proc
|
||||
@Value("${sendMq:true}")
|
||||
private Boolean sendMQ;
|
||||
|
||||
public SyncToEsProcessEventListener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 2;
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.job.AsyncApproveTaskJobHandler;
|
||||
import cn.axzo.workflow.core.engine.tx.listener.AutoPassTransactionListener;
|
||||
import cn.axzo.workflow.core.engine.tx.listener.AutoRejectTransactionListener;
|
||||
@ -14,7 +15,6 @@ import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import cn.axzo.workflow.core.version.MultiVersionBeanUtils;
|
||||
import cn.axzo.workflow.server.controller.listener.task.service.CheckApproverService;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
@ -23,6 +23,7 @@ import org.flowable.common.engine.impl.context.Context;
|
||||
import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.job.service.JobService;
|
||||
import org.flowable.job.service.impl.persistence.entity.JobEntity;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
@ -32,6 +33,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -50,15 +52,19 @@ import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@AllArgsConstructor
|
||||
public class AutoOperatorEvent_101_Listener extends AbstractBpmnEventListener<TaskOperationContext> implements BpmnTaskEventListener, Ordered {
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
public AutoOperatorEvent_101_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 101;
|
||||
}
|
||||
|
||||
private final RepositoryService repositoryService;
|
||||
|
||||
@Override
|
||||
public void onCreated(DelegateTask delegateTask) {
|
||||
log.info("AutoOperatorEvent_101_Listener#onCreated...{}, processInstanceId:{}", delegateTask.getTaskDefinitionKey(), delegateTask.getProcessInstanceId());
|
||||
|
||||
@ -11,6 +11,7 @@ import cn.axzo.workflow.common.model.request.bpmn.model.doc.DocCloneDTO;
|
||||
import cn.axzo.workflow.common.model.response.bpmn.model.doc.DocBaseVO;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.cmd.CustomGetModelDocsCmd;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
@ -28,6 +29,7 @@ import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -79,6 +81,10 @@ public class FirstCopyTemplateFileTaskEvent_105_Listener extends AbstractBpmnEve
|
||||
@Resource
|
||||
private WpsUtil wpsUtil;
|
||||
|
||||
public FirstCopyTemplateFileTaskEvent_105_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted(DelegateTask delegateTask) {
|
||||
if (!Objects.equals(NODE_STARTER.getType(), delegateTask.getTaskDefinitionKey())) {
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.axzo.workflow.common.model.request.bpmn.BpmnNoticeConf;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.engine.event.BizSpecifyAssigneeEventImpl;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventBuilder;
|
||||
import cn.axzo.workflow.core.engine.event.MessagePushEventImpl;
|
||||
@ -14,7 +15,6 @@ import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.bpmn.model.UserTask;
|
||||
@ -25,6 +25,7 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -32,6 +33,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@ -57,22 +59,23 @@ import static cn.axzo.workflow.core.engine.event.BizSpecifyAssigneeEventType.ADD
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@AllArgsConstructor
|
||||
public class MessagePushTaskEvent_103_Listener extends AbstractBpmnEventListener<TaskOperationContext> implements BpmnTaskEventListener, Ordered {
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 103;
|
||||
}
|
||||
|
||||
private final RuntimeService runtimeService;
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
public MessagePushTaskEvent_103_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAssigned(DelegateTask delegateTask) {
|
||||
log.info("MessagePushTaskEvent_103_Listener#onAssigned...{}, assignee: {}, taskId: {}, processInstanceId:{}",
|
||||
delegateTask.getTaskDefinitionKey(), delegateTask.getAssignee(), delegateTask.getId(), delegateTask.getProcessInstanceId());
|
||||
// if (Objects.equals(NODE_STARTER.getType(), delegateTask.getTaskDefinitionKey())) {
|
||||
// return;
|
||||
// }
|
||||
if (StringUtils.hasLength(delegateTask.getAssignee()) && delegateTask.getAssignee().contains(TASK_ASSIGNEE_SKIP_FLAT)) {
|
||||
// 转交功能原审批人完成待办, 由于在流程引擎侧, 任务是不会在转交时立即结束, 但待办消息需要立即完成,
|
||||
// 下面的 onDelete 事件根据测试情况,看是否需要过滤掉这种任务的"完成待办"事件的推送
|
||||
@ -100,9 +103,6 @@ public class MessagePushTaskEvent_103_Listener extends AbstractBpmnEventListener
|
||||
@Override
|
||||
public void onDeleted(DelegateTask delegateTask) {
|
||||
log.info("MessagePushTaskEvent_103_Listener#onDeleted...{}, processInstanceId:{}", delegateTask.getTaskDefinitionKey(), delegateTask.getProcessInstanceId());
|
||||
// if (Objects.equals(NODE_STARTER.getType(), delegateTask.getTaskDefinitionKey())) {
|
||||
// return;
|
||||
// }
|
||||
pendingCompleteEvent(delegateTask);
|
||||
log.info("MessagePushTaskEvent_103_Listener#onDeleted...end: {}, processInstanceId:{}", delegateTask.getTaskDefinitionKey(), delegateTask.getProcessInstanceId());
|
||||
}
|
||||
|
||||
@ -8,19 +8,16 @@ import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.common.model.response.mq.ProcessTaskDTO;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import cn.axzo.workflow.core.service.converter.BpmnHistoricAttachmentConverter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.bpmn.model.Process;
|
||||
import org.flowable.engine.RepositoryService;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.engine.repository.Deployment;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.form.api.FormInfo;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.form.model.SimpleFormModel;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@ -64,6 +61,10 @@ import static cn.axzo.workflow.common.enums.ProcessTaskEventEnum.PROCESS_TASK_TR
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListener<TaskOperationContext> implements BpmnTaskEventListener, Ordered {
|
||||
public RocketMqBpmnTaskEvent_102_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 102;
|
||||
@ -74,15 +75,9 @@ public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListene
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
@Resource
|
||||
private BpmnHistoricAttachmentConverter attachmentConverter;
|
||||
@Resource
|
||||
private RepositoryService repositoryService;
|
||||
@Value("${sendMq:true}")
|
||||
private Boolean sendMQ;
|
||||
@Resource
|
||||
private FormRepositoryService formRepositoryService;
|
||||
|
||||
@Override
|
||||
public void onAssigned(DelegateTask delegateTask) {
|
||||
@ -148,25 +143,6 @@ public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListene
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(delegateTask.getProcessInstanceId()).singleResult();
|
||||
String category = getDeployment(delegateTask.getProcessInstanceId()).getKey();
|
||||
|
||||
SimpleFormModel formModel = getContext().getFormModel(() -> {
|
||||
try {
|
||||
if (!Objects.equals("gongrendanganqianshu", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("jinengpeixun", processInstance.getProcessDefinitionKey()) &&
|
||||
!Objects.equals("anquanjiaoyu", processInstance.getProcessDefinitionKey())) {
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
FormInfo formInfo = formRepositoryService.getFormModelByKey(processInstance.getProcessDefinitionKey(), processInstance.getTenantId(), true);
|
||||
if (Objects.isNull(formInfo)) {
|
||||
return new SimpleFormModel();
|
||||
} else {
|
||||
return (SimpleFormModel) formInfo.getFormModel();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("没有找到对应业务 ID 的表单模型: {}", e.getMessage());
|
||||
return new SimpleFormModel();
|
||||
}
|
||||
});
|
||||
|
||||
ProcessTaskDTO dto = new ProcessTaskDTO()
|
||||
.setType(type)
|
||||
.setCategory(category)
|
||||
@ -179,7 +155,7 @@ public class RocketMqBpmnTaskEvent_102_Listener extends AbstractBpmnEventListene
|
||||
.setInitiator(BpmnTaskDelegateAssigner.toObjectCompatible(delegateTask.getVariable(INTERNAL_INITIATOR)))
|
||||
.setApprover(BpmnTaskDelegateAssigner.toObjectCompatible(
|
||||
delegateTask.getVariable(INTERNAL_TASK_RELATION_ASSIGNEE_INFO + delegateTask.getId())))
|
||||
.setVariables(removeBpmnConstantsVariables(delegateTask.getVariables(), formModel.allFieldsAsMap().keySet()))
|
||||
.setVariables(removeBpmnConstantsVariables(delegateTask.getVariables(), processInstance.getProcessDefinitionKey(), processInstance.getTenantId()))
|
||||
.setStartTime(delegateTask.getCreateTime())
|
||||
.setTenantId(delegateTask.getTenantId())
|
||||
.setBusinessKey(processInstance.getBusinessKey())
|
||||
|
||||
@ -2,18 +2,20 @@ package cn.axzo.workflow.server.controller.listener.task;
|
||||
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -33,15 +35,20 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELAT
|
||||
@Slf4j
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
@AllArgsConstructor
|
||||
public class SnapshotBpmnTaskEvent_100_Listener extends AbstractBpmnEventListener<TaskOperationContext> implements BpmnTaskEventListener, Ordered {
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 100;
|
||||
}
|
||||
|
||||
private final RuntimeService runtimeService;
|
||||
private final TaskService taskService;
|
||||
public SnapshotBpmnTaskEvent_100_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAssigned(DelegateTask delegateTask) {
|
||||
|
||||
@ -4,9 +4,11 @@ import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventProducer;
|
||||
import cn.axzo.workflow.common.enums.ElasticSearchEventEnum;
|
||||
import cn.axzo.workflow.core.common.context.TaskOperationContext;
|
||||
import cn.axzo.workflow.core.conf.SupportRefreshProperties;
|
||||
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
|
||||
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.form.api.FormRepositoryService;
|
||||
import org.flowable.task.service.delegate.DelegateTask;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
@ -30,6 +32,10 @@ public class SyncToEsTaskEvent_104_Listener extends AbstractBpmnEventListener<Ta
|
||||
@Value("${sendMq:true}")
|
||||
private Boolean sendMQ;
|
||||
|
||||
public SyncToEsTaskEvent_104_Listener(FormRepositoryService formRepositoryService, SupportRefreshProperties refreshProperties) {
|
||||
super(formRepositoryService, refreshProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Integer.MIN_VALUE + 104;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user