|
@@ -0,0 +1,26 @@
|
|
|
|
+package com.aizuda.boot.config;
|
|
|
|
+
|
|
|
|
+import com.aizuda.bpm.engine.FlowLongEngine;
|
|
|
|
+import com.aizuda.bpm.engine.FlowLongScheduler;
|
|
|
|
+import com.aizuda.bpm.engine.scheduling.JobLock;
|
|
|
|
+import com.aizuda.bpm.spring.autoconfigure.FlowLongProperties;
|
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
+
|
|
|
|
+@EnableScheduling
|
|
|
|
+@Configuration
|
|
|
|
+public class BpmConfiguration {
|
|
|
|
+
|
|
|
|
+ @Bean
|
|
|
|
+ @ConditionalOnMissingBean
|
|
|
|
+ public FlowLongScheduler springBootScheduler(FlowLongEngine flowLongEngine, FlowLongProperties properties, JobLock jobLock) {
|
|
|
|
+ FlowLongScheduler scheduler = new BpmScheduler();
|
|
|
|
+ scheduler.setFlowLongEngine(flowLongEngine);
|
|
|
|
+ scheduler.setRemindParam(properties.getRemind());
|
|
|
|
+ scheduler.setTaskReminder((context, instanceId, currentTaskId) -> System.out.println("测试提醒:" + instanceId));
|
|
|
|
+ scheduler.setJobLock(jobLock);
|
|
|
|
+ return scheduler;
|
|
|
|
+ }
|
|
|
|
+}
|