update - 业务节点"不设置审批人"配置时, 根据审批方式调整执行监听的配置是否要添加 engineExecutionStartListener

This commit is contained in:
wangli 2024-02-05 11:29:01 +08:00
parent ce61f8f56d
commit a1d0dc424a

View File

@ -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<ReceiveT
// "设置审批人"
setApprovalExtensionElement(node, receiveTask);
setExecutionListeners(receiveTask);
// 设置执行监听
setExecutionListeners(node, receiveTask);
return receiveTask;
}
private static void setExecutionListeners(ReceiveTask receiveTask) {
private static void setExecutionListeners(BpmnJsonNode node, ReceiveTask receiveTask) {
List<FlowableListener> 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);