mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
初步完成 liteflow-solon-plugin 适配
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package com.yomahub.liteflow.solon.config;
|
||||
|
||||
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.monitor.MonitorBus;
|
||||
import com.yomahub.liteflow.property.LiteflowConfig;
|
||||
import org.noear.solon.annotation.Bean;
|
||||
import org.noear.solon.annotation.Configuration;
|
||||
import org.noear.solon.annotation.Init;
|
||||
import org.noear.solon.annotation.Inject;
|
||||
import org.noear.solon.core.AopContext;
|
||||
|
||||
@@ -21,24 +19,27 @@ import org.noear.solon.core.AopContext;
|
||||
@Configuration
|
||||
public class LiteflowMainAutoConfiguration {
|
||||
|
||||
@Inject(value = "${liteflow.parseOnStart}",required = false)
|
||||
@Inject(value = "${liteflow.parseOnStart}", required = false)
|
||||
boolean parseOnStart;
|
||||
|
||||
@Inject
|
||||
AopContext aopContext;
|
||||
|
||||
//实例化FlowExecutor
|
||||
@Bean
|
||||
public FlowExecutor flowExecutor(LiteflowConfig liteflowConfig) {
|
||||
@Inject
|
||||
LiteflowConfig liteflowConfig;
|
||||
|
||||
@Init
|
||||
public void flowExecutor() {
|
||||
//
|
||||
//实例化FlowExecutor
|
||||
//
|
||||
FlowExecutor flowExecutor = new FlowExecutor();
|
||||
flowExecutor.setLiteflowConfig(liteflowConfig);
|
||||
|
||||
if (parseOnStart) {
|
||||
aopContext.beanOnloaded((c) -> {
|
||||
flowExecutor.init(true);
|
||||
});
|
||||
flowExecutor.init(true);
|
||||
}
|
||||
|
||||
return flowExecutor;
|
||||
aopContext.wrapAndPut(FlowExecutor.class, flowExecutor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class XPluginImpl implements Plugin {
|
||||
context.beanMake(LiteflowProperty.class);
|
||||
context.beanMake(LiteflowMonitorProperty.class);
|
||||
context.beanMake(LiteflowAutoConfiguration.class);
|
||||
context.beanMake(LiteflowMainAutoConfiguration.class);
|
||||
|
||||
//订阅 NodeComponent 组件
|
||||
context.subWrapsOfType(NodeComponent.class, bw -> {
|
||||
@@ -94,11 +95,5 @@ public class XPluginImpl implements Plugin {
|
||||
context.beanExtract(bw); //尝试提取 LiteflowMethod 函数
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//扫描相关组件
|
||||
context.beanOnloaded((ctx)->{
|
||||
context.beanMake(LiteflowMainAutoConfiguration.class);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user