From c1d6c7066857925b4862dd837842963835cb3ae9 Mon Sep 17 00:00:00 2001 From: renfei Date: Fri, 13 Feb 2026 15:01:19 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0warmflow=EF=BC=8C?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=88=B01.8.5-SNAPSHOT=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81dubbo=20rpc=E8=B0=83=E9=80=9Alistener?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 28 +++++- warm-flow-core/pom.xml | 7 +- .../flow/core/config/DubboProperties.java | 55 +++++++++++ .../core/handler/DubboGenericHandler.java | 96 +++++++++++++++++++ .../flow/core/listener/ListenerVariable.java | 3 +- .../warm/flow/core/utils/ListenerUtil.java | 23 +++++ warm-flow-orm/pom.xml | 2 +- warm-flow-orm/warm-flow-mybatis-plus/pom.xml | 2 +- .../warm-flow-mybatis-plus-core/pom.xml | 2 +- .../warm-flow-mybatis-plus-sb-starter/pom.xml | 2 +- .../spring/boot/config/DubboAutoConfig.java | 37 +++++++ .../main/resources/META-INF/spring.factories | 4 +- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../pom.xml | 2 +- .../pom.xml | 2 +- warm-flow-orm/warm-flow-mybatis/pom.xml | 2 +- .../warm-flow-mybatis-core/pom.xml | 2 +- .../warm-flow-mybatis-sb-starter/pom.xml | 2 +- .../warm-flow-mybatis-sb3-starter/pom.xml | 2 +- .../warm-flow-mybatis-solon-plugin/pom.xml | 2 +- warm-flow-plugin/pom.xml | 2 +- .../warm-flow-plugin-json/pom.xml | 2 +- .../warm-flow-plugin-modes/pom.xml | 2 +- .../warm-flow-plugin-modes-sb/pom.xml | 12 ++- .../warm-flow-plugin-modes-solon/pom.xml | 2 +- warm-flow-plugin/warm-flow-plugin-ui/pom.xml | 2 +- .../warm-flow-plugin-ui-core/pom.xml | 2 +- .../warm-flow-plugin-ui-sb-web/pom.xml | 2 +- .../warm-flow-plugin-ui-solon-web/pom.xml | 2 +- .../warm-flow-plugin-vue3-ui/pom.xml | 2 +- 30 files changed, 281 insertions(+), 25 deletions(-) create mode 100644 warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java create mode 100644 warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java create mode 100644 warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java diff --git a/pom.xml b/pom.xml index a797664c..d00c7e6f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow - 1.8.4 + 1.8.5-SNAPSHOT pom warm-flow @@ -96,6 +96,9 @@ 4.13.2 1.7.36 + + + 3.3.2 @@ -340,9 +343,32 @@ warm-flow-plugin-ui-solon-web ${warm-flow} + + + + org.apache.dubbo + dubbo-bom + ${dubbo.version} + pom + import + + + + + sdwks + sdwks-releases + https://lib.sdwks.com/repository/maven-releases/ + + + sdwks + sdwks-snapshots + https://lib.sdwks.com/repository/maven-snapshots/ + + + diff --git a/warm-flow-core/pom.xml b/warm-flow-core/pom.xml index 94019985..98cc94c6 100644 --- a/warm-flow-core/pom.xml +++ b/warm-flow-core/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-core @@ -30,5 +30,10 @@ lombok provided + + + org.apache.dubbo + dubbo + diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java new file mode 100644 index 00000000..3413335f --- /dev/null +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java @@ -0,0 +1,55 @@ +package org.dromara.warm.flow.core.config; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import org.apache.dubbo.config.ApplicationConfig; +import org.apache.dubbo.config.ConsumerConfig; +import org.apache.dubbo.config.ProtocolConfig; +import org.apache.dubbo.config.RegistryConfig; + +import java.io.Serializable; + +/** + * @author monster + * @version 1.0 + * @description: dubbo 配置 + * @date 2026/2/11 10:35 + */ +@ToString +@Getter +@Setter +public class DubboProperties implements Serializable { + /** + * dubbo application + */ + private ApplicationConfig application = new ApplicationConfig(); + + /** + * dubbo registry + */ + private RegistryConfig registry = new RegistryConfig(); + + /** + * dubbo protocol + */ + private ProtocolConfig protocol = new ProtocolConfig(); + + /** + * dubbo consumer + */ + private ConsumerConfig consumer = new ConsumerConfig(); + + /** + * 接口版本号 + */ + private String version; + + /** + * dubbo 调用超时时间 + */ + private Integer timeout; + + public DubboProperties() { + } +} diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java new file mode 100644 index 00000000..9703a88c --- /dev/null +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java @@ -0,0 +1,96 @@ +package org.dromara.warm.flow.core.handler; + +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.ReferenceConfig; +import org.apache.dubbo.config.bootstrap.builders.ReferenceBuilder; +import org.apache.dubbo.rpc.service.GenericService; +import org.dromara.warm.flow.core.config.DubboProperties; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author monster + * @version 1.0 + * @description: TODO + * @date 2026/2/11 10:19 + */ +@Slf4j +public class DubboGenericHandler { + private static final Map> referenceCache = new ConcurrentHashMap<>(); + + private DubboProperties dubboProperties; + + public DubboGenericHandler(DubboProperties dubboProperties) { + this.dubboProperties = dubboProperties; + } + + /** + * 获取或创建 ReferenceConfig + * + * @param interfaceName 接口名 + * @return ReferenceConfig 实例 + */ + private ReferenceConfig getOrCreateReference(String interfaceName) { + return referenceCache.computeIfAbsent(interfaceName, key -> { + log.info("Creating new ReferenceConfig for interface: {}", key); + ReferenceConfig config = ReferenceBuilder.newBuilder() + .application(dubboProperties.getApplication()) + .consumer(dubboProperties.getConsumer()) + .addRegistry(dubboProperties.getRegistry()) + .version(dubboProperties.getVersion()) + .timeout(60 * 1000) + .interfaceName(interfaceName) + .generic(Boolean.TRUE) + .build(); + return config; // 放入缓存 + }); + } + + /** + * Spring 容器销毁该 Bean 前,清理所有缓存的 ReferenceConfig + */ + public void destroyAllReferences() { + log.info("Shutting down DubboGenericHandler and destroying all cached references."); + referenceCache.values().forEach(config -> { + try { + config.destroy(); // 销毁每个 ReferenceConfig,释放资源 + log.debug("Destroyed reference for interface: {}", config.getInterface()); + } catch (Exception e) { + log.warn("Error destroying reference for interface: {}", config.getInterface(), e); + } + }); + referenceCache.clear(); + } + + /** + * 执行泛化调用 + * + * @param interfaceName 接口全限定名,例如 "org.sdwks.com.facade.UserReadFacade" + * @param methodName 要调用的方法名 + * @param parameterTypes 参数类型数组 (FQCN) + * @param args 参数值数组 + * @return 调用结果 + */ + public Object invoke(String interfaceName, String methodName, List parameterTypes, List args) { + // 从缓存中获取或创建 ReferenceConfig + ReferenceConfig reference = getOrCreateReference(interfaceName); + + log.warn("DubboGenericHandler.interfaceName:{} !!!!", interfaceName); + if (reference == null) { + throw new RuntimeException("Failed to create reference for interface: " + interfaceName); + } + + GenericService genericService = reference.get(); + try { + // 执行调用 + Object result = genericService.$invoke(methodName, parameterTypes.toArray(new String[]{}), args.toArray()); + log.info("Successfully invoked method: {} on interface: {}, result: {}", methodName, interfaceName, result); + return result; + } catch (Exception e) { + log.error("Generic invoke failed. Interface: {}, Method: {}", interfaceName, methodName, e); + throw new RuntimeException(e); + } + } +} diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/listener/ListenerVariable.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/listener/ListenerVariable.java index bdd693bc..f228511e 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/listener/ListenerVariable.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/listener/ListenerVariable.java @@ -21,6 +21,7 @@ import org.dromara.warm.flow.core.entity.Instance; import org.dromara.warm.flow.core.entity.Node; import org.dromara.warm.flow.core.entity.Task; +import java.io.Serializable; import java.util.List; import java.util.Map; @@ -29,7 +30,7 @@ import java.util.Map; * * @author warm */ -public class ListenerVariable { +public class ListenerVariable implements Serializable { /** * 流程定义 diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java index 8e40c883..8aca9e5c 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java @@ -15,17 +15,20 @@ */ package org.dromara.warm.flow.core.utils; +import lombok.extern.slf4j.Slf4j; import org.dromara.warm.flow.core.FlowEngine; import org.dromara.warm.flow.core.constant.FlowCons; import org.dromara.warm.flow.core.entity.Definition; import org.dromara.warm.flow.core.entity.Task; import org.dromara.warm.flow.core.enums.NodeType; +import org.dromara.warm.flow.core.handler.DubboGenericHandler; import org.dromara.warm.flow.core.invoker.FrameInvoker; import org.dromara.warm.flow.core.listener.GlobalListener; import org.dromara.warm.flow.core.listener.Listener; import org.dromara.warm.flow.core.listener.ListenerVariable; import org.dromara.warm.flow.core.listener.ValueHolder; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,6 +39,7 @@ import java.util.regex.Matcher; * * @author warm */ +@Slf4j public class ListenerUtil { private ListenerUtil() { @@ -79,6 +83,7 @@ public class ListenerUtil { } public static void execute(ListenerVariable listenerVariable, String type, String listenerPaths, String listenerTypes) { + log.warn("listenerUtils.start !!!!"); if (StringUtils.isNotEmpty(listenerTypes)) { String[] listenerTypeArr = listenerTypes.split(","); for (int i = 0; i < listenerTypeArr.length; i++) { @@ -97,9 +102,12 @@ public class ListenerUtil { return; } + log.warn("listenerUtils.start !!!!valueHolder.getPath():{}", valueHolder.getPath()); + Class clazz = ClassUtil.getClazz(valueHolder.getPath()); // 增加传入类路径校验Listener接口, 防止强制类型转换失败 if (ObjectUtil.isNotNull(clazz) && Listener.class.isAssignableFrom(clazz)) { + // org.dromara.warm.plugin.modes.sb.config.BeanConfig.initFlow Listener listener = (Listener) FrameInvoker.getBean(clazz); if (ObjectUtil.isNotNull(listener)) { Map variable = listenerVariable.getVariable(); @@ -114,6 +122,21 @@ public class ListenerUtil { listener.notify(listenerVariable.setVariable(variable)); } + }else{// 尝试去注册中心找 RPC 接口实现,modify by monster 20260211 + log.warn("DubboGenericHandler.start !!!!"); + DubboGenericHandler dubboGenericHandler = FrameInvoker.getBean(DubboGenericHandler.class); + Map variable = listenerVariable.getVariable(); + if (MapUtil.isEmpty(variable)) { + variable = new HashMap<>(); + } else { + variable.remove(FlowCons.WARM_LISTENER_PARAM); + } + if (StringUtils.isNotEmpty(valueHolder.getParams())) { + variable.put(FlowCons.WARM_LISTENER_PARAM, valueHolder.getParams()); + } + dubboGenericHandler.invoke(valueHolder.getPath(), "notify", + CollUtil.toList("org.dromara.warm.flow.core.listener.ListenerVariable"), + CollUtil.toList(listenerVariable.setVariable(variable))); } } } diff --git a/warm-flow-orm/pom.xml b/warm-flow-orm/pom.xml index 126ce8a2..c85fe14a 100644 --- a/warm-flow-orm/pom.xml +++ b/warm-flow-orm/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-orm diff --git a/warm-flow-orm/warm-flow-mybatis-plus/pom.xml b/warm-flow-orm/warm-flow-mybatis-plus/pom.xml index 723d2421..e81e2a72 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis-plus/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-orm - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-plus diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-core/pom.xml b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-core/pom.xml index 42515af7..4be083b3 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-core/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-core/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis-plus - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-plus-core diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/pom.xml b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/pom.xml index 6870d30d..76a8319c 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis-plus - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-plus-sb-starter diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java new file mode 100644 index 00000000..84d50fd4 --- /dev/null +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java @@ -0,0 +1,37 @@ +package org.dromara.warm.flow.spring.boot.config; + +import org.apache.dubbo.spring.boot.autoconfigure.DubboConfigurationProperties; +import org.dromara.warm.flow.core.config.DubboProperties; +import org.dromara.warm.flow.core.handler.DubboGenericHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author monster + * @version 1.0 + * @description: TODO + * @date 2026/2/11 13:53 + */ +@Configuration +@EnableConfigurationProperties(DubboConfigurationProperties.class) +public class DubboAutoConfig { + private static final Logger log = LoggerFactory.getLogger(DubboAutoConfig.class); + + @Bean + public DubboGenericHandler dubboGenericHandler(DubboConfigurationProperties dubboConfigurationProperties) { + DubboProperties dubboProperties = new DubboProperties(); + dubboProperties.setApplication(dubboConfigurationProperties.getApplication()); + dubboProperties.setRegistry(dubboConfigurationProperties.getRegistry()); + dubboProperties.setProtocol(dubboConfigurationProperties.getProtocol()); + dubboProperties.setConsumer(dubboConfigurationProperties.getConsumer()); + dubboProperties.setVersion(dubboConfigurationProperties.getConsumer().getVersion()); + dubboProperties.setTimeout(dubboConfigurationProperties.getConsumer().getTimeout()); + + log.info("!!!!!!!!create dubboGenericHandler bean success DubboProperties: {}", dubboProperties); + + return new DubboGenericHandler(dubboProperties); + } +} diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring.factories b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring.factories index 6543e11d..7ca43935 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring.factories +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring.factories @@ -1,2 +1,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.dromara.warm.flow.spring.boot.config.FlowAutoConfig + org.dromara.warm.flow.spring.boot.config.FlowAutoConfig,\ + org.dromara.warm.flow.spring.boot.config.DubboAutoConfig + diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 264198f5..61a63c0e 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1,2 @@ org.dromara.warm.flow.spring.boot.config.FlowAutoConfig +org.dromara.warm.flow.spring.boot.config.DubboAutoConfig diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb3-starter/pom.xml b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb3-starter/pom.xml index 03164cba..be0499ad 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb3-starter/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb3-starter/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis-plus - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-plus-sb3-starter diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-solon-plugin/pom.xml b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-solon-plugin/pom.xml index 2e7b4144..a6f01ef7 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-solon-plugin/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-solon-plugin/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis-plus - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-plus-solon-plugin diff --git a/warm-flow-orm/warm-flow-mybatis/pom.xml b/warm-flow-orm/warm-flow-mybatis/pom.xml index 5c1128a2..5f481f61 100644 --- a/warm-flow-orm/warm-flow-mybatis/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-orm - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis diff --git a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-core/pom.xml b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-core/pom.xml index fa1e7f9a..41bbfb84 100644 --- a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-core/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-core/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-core diff --git a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb-starter/pom.xml b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb-starter/pom.xml index 9389c9e7..6372490f 100644 --- a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb-starter/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb-starter/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-sb-starter diff --git a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb3-starter/pom.xml b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb3-starter/pom.xml index 1cf1efe7..d9b14f93 100644 --- a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb3-starter/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-sb3-starter/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-sb3-starter diff --git a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-solon-plugin/pom.xml b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-solon-plugin/pom.xml index af676118..9e6906a3 100644 --- a/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-solon-plugin/pom.xml +++ b/warm-flow-orm/warm-flow-mybatis/warm-flow-mybatis-solon-plugin/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-mybatis - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-mybatis-solon-plugin diff --git a/warm-flow-plugin/pom.xml b/warm-flow-plugin/pom.xml index 6c00e664..2fe57c60 100644 --- a/warm-flow-plugin/pom.xml +++ b/warm-flow-plugin/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin diff --git a/warm-flow-plugin/warm-flow-plugin-json/pom.xml b/warm-flow-plugin/warm-flow-plugin-json/pom.xml index 8648d80f..19559c6f 100644 --- a/warm-flow-plugin/warm-flow-plugin-json/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-json/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-json diff --git a/warm-flow-plugin/warm-flow-plugin-modes/pom.xml b/warm-flow-plugin/warm-flow-plugin-modes/pom.xml index 4713d6fc..badfc35d 100644 --- a/warm-flow-plugin/warm-flow-plugin-modes/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-modes/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-modes diff --git a/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-sb/pom.xml b/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-sb/pom.xml index fa63e1d5..35c2b6c2 100644 --- a/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-sb/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-sb/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-modes - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-modes-sb @@ -58,6 +58,16 @@ true + + + org.apache.dubbo + dubbo-spring-boot-starter + + + org.apache.dubbo + dubbo-nacos-spring-boot-starter + + diff --git a/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-solon/pom.xml b/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-solon/pom.xml index 433aaf75..273583fa 100644 --- a/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-solon/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-modes/warm-flow-plugin-modes-solon/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-modes - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-modes-solon diff --git a/warm-flow-plugin/warm-flow-plugin-ui/pom.xml b/warm-flow-plugin/warm-flow-plugin-ui/pom.xml index 1f627322..03616c6b 100644 --- a/warm-flow-plugin/warm-flow-plugin-ui/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-ui/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-ui diff --git a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-core/pom.xml b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-core/pom.xml index 7de1b5e9..8e174935 100644 --- a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-core/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-core/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-ui - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-ui-core diff --git a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-sb-web/pom.xml b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-sb-web/pom.xml index cf19106e..50727584 100644 --- a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-sb-web/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-sb-web/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-ui - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-ui-sb-web diff --git a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-solon-web/pom.xml b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-solon-web/pom.xml index eda258d4..bbb5864e 100644 --- a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-solon-web/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-ui-solon-web/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-ui - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-ui-solon-web diff --git a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-vue3-ui/pom.xml b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-vue3-ui/pom.xml index b0b14575..bae97d6f 100644 --- a/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-vue3-ui/pom.xml +++ b/warm-flow-plugin/warm-flow-plugin-ui/warm-flow-plugin-vue3-ui/pom.xml @@ -6,7 +6,7 @@ org.dromara.warm warm-flow-plugin-ui - 1.8.4 + 1.8.5-SNAPSHOT warm-flow-plugin-vue3-ui -- Gitee From d497d36f18d8cd0f121e9005b77f3b7c4c1fdcf4 Mon Sep 17 00:00:00 2001 From: renfei Date: Sat, 14 Feb 2026 08:49:27 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E8=AF=95=E6=B3=A8=E8=A7=A3=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0@bean=E6=98=AF=E7=9A=84destroyMethod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warm/flow/core/handler/DubboGenericHandler.java | 2 +- .../org/dromara/warm/flow/core/utils/ListenerUtil.java | 4 ---- .../warm/flow/spring/boot/config/DubboAutoConfig.java | 10 ++-------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java index 9703a88c..9d8d2cda 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java @@ -13,7 +13,7 @@ import java.util.concurrent.ConcurrentHashMap; /** * @author monster * @version 1.0 - * @description: TODO + * @description: dubbo 泛化调用handler * @date 2026/2/11 10:19 */ @Slf4j diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java index 8aca9e5c..18ec406f 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java @@ -83,7 +83,6 @@ public class ListenerUtil { } public static void execute(ListenerVariable listenerVariable, String type, String listenerPaths, String listenerTypes) { - log.warn("listenerUtils.start !!!!"); if (StringUtils.isNotEmpty(listenerTypes)) { String[] listenerTypeArr = listenerTypes.split(","); for (int i = 0; i < listenerTypeArr.length; i++) { @@ -102,12 +101,9 @@ public class ListenerUtil { return; } - log.warn("listenerUtils.start !!!!valueHolder.getPath():{}", valueHolder.getPath()); - Class clazz = ClassUtil.getClazz(valueHolder.getPath()); // 增加传入类路径校验Listener接口, 防止强制类型转换失败 if (ObjectUtil.isNotNull(clazz) && Listener.class.isAssignableFrom(clazz)) { - // org.dromara.warm.plugin.modes.sb.config.BeanConfig.initFlow Listener listener = (Listener) FrameInvoker.getBean(clazz); if (ObjectUtil.isNotNull(listener)) { Map variable = listenerVariable.getVariable(); diff --git a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java index 84d50fd4..f2e1fe83 100644 --- a/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java +++ b/warm-flow-orm/warm-flow-mybatis-plus/warm-flow-mybatis-plus-sb-starter/src/main/java/org/dromara/warm/flow/spring/boot/config/DubboAutoConfig.java @@ -3,8 +3,6 @@ package org.dromara.warm.flow.spring.boot.config; import org.apache.dubbo.spring.boot.autoconfigure.DubboConfigurationProperties; import org.dromara.warm.flow.core.config.DubboProperties; import org.dromara.warm.flow.core.handler.DubboGenericHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -12,15 +10,13 @@ import org.springframework.context.annotation.Configuration; /** * @author monster * @version 1.0 - * @description: TODO + * @description: dubbo 自动配置 * @date 2026/2/11 13:53 */ @Configuration @EnableConfigurationProperties(DubboConfigurationProperties.class) public class DubboAutoConfig { - private static final Logger log = LoggerFactory.getLogger(DubboAutoConfig.class); - - @Bean + @Bean(destroyMethod = "destroyAllReferences") public DubboGenericHandler dubboGenericHandler(DubboConfigurationProperties dubboConfigurationProperties) { DubboProperties dubboProperties = new DubboProperties(); dubboProperties.setApplication(dubboConfigurationProperties.getApplication()); @@ -30,8 +26,6 @@ public class DubboAutoConfig { dubboProperties.setVersion(dubboConfigurationProperties.getConsumer().getVersion()); dubboProperties.setTimeout(dubboConfigurationProperties.getConsumer().getTimeout()); - log.info("!!!!!!!!create dubboGenericHandler bean success DubboProperties: {}", dubboProperties); - return new DubboGenericHandler(dubboProperties); } } -- Gitee From 8976745e43fc897635962a3a53287b5cf306c912 Mon Sep 17 00:00:00 2001 From: renfei Date: Sat, 14 Feb 2026 09:53:53 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/warm/flow/core/utils/ListenerUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java index 18ec406f..9a5831ac 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java @@ -130,7 +130,7 @@ public class ListenerUtil { if (StringUtils.isNotEmpty(valueHolder.getParams())) { variable.put(FlowCons.WARM_LISTENER_PARAM, valueHolder.getParams()); } - dubboGenericHandler.invoke(valueHolder.getPath(), "notify", + listenerVariable = (ListenerVariable) dubboGenericHandler.invoke(valueHolder.getPath(), "notify", CollUtil.toList("org.dromara.warm.flow.core.listener.ListenerVariable"), CollUtil.toList(listenerVariable.setVariable(variable))); } -- Gitee From b6db69945a79ad6d82a7e2951111665818a15596 Mon Sep 17 00:00:00 2001 From: renfei Date: Sat, 14 Feb 2026 10:13:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/warm/flow/core/entity/Instance.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java index 9275e8a6..3b5efcb5 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java @@ -17,6 +17,7 @@ package org.dromara.warm.flow.core.entity; import org.dromara.warm.flow.core.FlowEngine; +import java.util.Collections; import java.util.Date; import java.util.Map; @@ -123,6 +124,11 @@ public interface Instance extends RootEntity { Instance setVariable(String variable); default Map getVariableMap() { + String variableStr = getVariable(); + if (variableStr == null || variableStr.isEmpty()) { // 检查 null 或空字符串 + // 如果 variable 为 null 或空,返回一个空的 Map,而不是让 strToMap 处理 null + return Collections.emptyMap(); + } return FlowEngine.jsonConvert.strToMap(getVariable()); } -- Gitee From 24f3cf7b9c48558eb66e24f11550be83a3aed641 Mon Sep 17 00:00:00 2001 From: renfei Date: Sat, 14 Feb 2026 12:41:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=94=AF=E6=8C=81dubbo=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E4=BC=A0=E5=8F=82=E9=80=8F=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warm/flow/core/entity/Instance.java | 5 ----- .../warm/flow/core/utils/ListenerUtil.java | 20 ++++++++++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java index 3b5efcb5..e494d5e1 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java @@ -124,11 +124,6 @@ public interface Instance extends RootEntity { Instance setVariable(String variable); default Map getVariableMap() { - String variableStr = getVariable(); - if (variableStr == null || variableStr.isEmpty()) { // 检查 null 或空字符串 - // 如果 variable 为 null 或空,返回一个空的 Map,而不是让 strToMap 处理 null - return Collections.emptyMap(); - } return FlowEngine.jsonConvert.strToMap(getVariable()); } diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java index 9a5831ac..28e1c7e6 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/utils/ListenerUtil.java @@ -15,6 +15,8 @@ */ package org.dromara.warm.flow.core.utils; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import lombok.extern.slf4j.Slf4j; import org.dromara.warm.flow.core.FlowEngine; import org.dromara.warm.flow.core.constant.FlowCons; @@ -33,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; +import java.util.stream.Collectors; /** * 监听器工具类 @@ -130,9 +133,24 @@ public class ListenerUtil { if (StringUtils.isNotEmpty(valueHolder.getParams())) { variable.put(FlowCons.WARM_LISTENER_PARAM, valueHolder.getParams()); } - listenerVariable = (ListenerVariable) dubboGenericHandler.invoke(valueHolder.getPath(), "notify", + Object object = dubboGenericHandler.invoke(valueHolder.getPath(), "notify", CollUtil.toList("org.dromara.warm.flow.core.listener.ListenerVariable"), CollUtil.toList(listenerVariable.setVariable(variable))); + ListenerVariable listenerVariableReturn = JSONObject.parseObject(JSON.toJSONString(object), ListenerVariable.class); + + if(CollUtil.isNotEmpty(listenerVariableReturn.getNextTasks())){ + Map taskMap = listenerVariableReturn.getNextTasks().stream().collect(Collectors.toMap(Task::getId, task -> task, (k1, k2) -> k1)); + if(CollUtil.isNotEmpty(listenerVariable.getNextTasks())){ + for (Task nextTask : listenerVariable.getNextTasks()) { + if(taskMap.containsKey(nextTask.getId())){ + nextTask.setPermissionList(taskMap.get(nextTask.getId()).getPermissionList()); + } + } + } + } + + listenerVariable.setFlowParams(listenerVariableReturn.getFlowParams()); + listenerVariable.setVariable(listenerVariableReturn.getVariable()); } } } -- Gitee From ab618a56c2dac214ccc6a792e21caa5abcd2b458 Mon Sep 17 00:00:00 2001 From: renfei Date: Tue, 24 Feb 2026 10:25:29 +0800 Subject: [PATCH 6/6] =?UTF-8?q?warmflowdubbo=E6=B3=9B=E5=8C=96=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/warm/flow/core/handler/DubboGenericHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java index 9d8d2cda..22a07dd4 100644 --- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java +++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java @@ -69,7 +69,7 @@ public class DubboGenericHandler { * * @param interfaceName 接口全限定名,例如 "org.sdwks.com.facade.UserReadFacade" * @param methodName 要调用的方法名 - * @param parameterTypes 参数类型数组 (FQCN) + * @param parameterTypes 参数类型数组 * @param args 参数值数组 * @return 调用结果 */ -- Gitee