|
@@ -0,0 +1,38 @@
|
|
|
|
|
+package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task;
|
|
|
|
|
+
|
|
|
|
|
+import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceCopyService;
|
|
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopRespVO;
|
|
|
|
|
+import cn.iocoder.yudao.module.iscs.service.sop.SopService;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
|
|
|
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
|
|
+import jakarta.annotation.Resource;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.flowable.engine.delegate.DelegateExecution;
|
|
|
|
|
+import org.flowable.engine.delegate.ExecutionListener;
|
|
|
|
|
+import org.flowable.engine.delegate.JavaDelegate;
|
|
|
|
|
+import org.flowable.engine.delegate.TaskListener;
|
|
|
|
|
+import org.flowable.task.service.delegate.DelegateTask;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 类型为 class 的 TaskListener 监听器示例
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author 芋道源码
|
|
|
|
|
+ */
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@Component
|
|
|
|
|
+public class SopDelegateClassTaskListener {
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private SopService sopService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public void execute(DelegateExecution execution) {
|
|
|
|
|
+ System.out.println("delegateTask=======" + execution);
|
|
|
|
|
+ SopRespVO sop = sopService.getSop(124L);
|
|
|
|
|
+ System.out.println("sop=======" + sop);
|
|
|
|
|
+ log.info("[execute][task({}) 被调用]", execution.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|