diff --git a/workflow-engine-core/src/main/java/cn/axzo/workflow/core/converter/json/ReceiveTaskJsonConverter.java b/workflow-engine-core/src/main/java/cn/axzo/workflow/core/converter/json/ReceiveTaskJsonConverter.java index 3428ea767..9c7e92505 100644 --- a/workflow-engine-core/src/main/java/cn/axzo/workflow/core/converter/json/ReceiveTaskJsonConverter.java +++ b/workflow-engine-core/src/main/java/cn/axzo/workflow/core/converter/json/ReceiveTaskJsonConverter.java @@ -1,5 +1,6 @@ package cn.axzo.workflow.core.converter.json; +import cn.axzo.workflow.common.enums.ApprovalMethodEnum; import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode; import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNodeProperty; import org.flowable.bpmn.model.ExtensionAttribute; @@ -35,19 +36,24 @@ public class ReceiveTaskJsonConverter extends AbstractBpmnJsonConverter executionListeners = new ArrayList<>(); - // 设置执行监听 - FlowableListener executionListener = new FlowableListener(); - executionListener.setEvent(BaseExecutionListener.EVENTNAME_START); - executionListener.setImplementationType(IMPLEMENTATION_TYPE_DELEGATEEXPRESSION); - executionListener.setImplementation("${engineExecutionStartListener}"); - executionListeners.add(executionListener); + + if (Objects.nonNull(node.getProperty()) && Objects.equals(node.getProperty().getApprovalMethod(), + ApprovalMethodEnum.nobody)) { + FlowableListener executionListener = new FlowableListener(); + executionListener.setEvent(BaseExecutionListener.EVENTNAME_START); + executionListener.setImplementationType(IMPLEMENTATION_TYPE_DELEGATEEXPRESSION); + executionListener.setImplementation("${engineExecutionStartListener}"); + executionListeners.add(executionListener); + } FlowableListener activityStartListener = new FlowableListener(); activityStartListener.setEvent(BaseExecutionListener.EVENTNAME_START);