From 2f41b4277eaa916d8a91ef282b8e2a276f1ab4a9 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Wed, 11 Oct 2023 08:46:57 +0800 Subject: [PATCH 01/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- .../src/main/resources/application.properties | 4 +-- .../flow/core/ExecutionListener.java | 2 +- .../smartboot/flow/core/util/BeanContext.java | 25 +++++++++++++++++++ .../smartboot/flow/core/util/BeanUtils.java | 16 ++++++++---- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/smart-flow-admin/src/main/resources/application.properties b/smart-flow-admin/src/main/resources/application.properties index 02c9784..3b86edd 100644 --- a/smart-flow-admin/src/main/resources/application.properties +++ b/smart-flow-admin/src/main/resources/application.properties @@ -1,4 +1,4 @@ server.port=8076 -# 刪除3天前的数据 -data.period.day=3 \ No newline at end of file +# 刪除30天前的数据 +data.period.day=30 \ No newline at end of file diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListener.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListener.java index 339a6eb..99fc2dd 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListener.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListener.java @@ -5,7 +5,7 @@ package org.smartboot.flow.core; * @date 2022-11-25 20:34:35 * @since 1.0.0 */ -public interface ExecutionListener { +public interface ExecutionListener extends Describable { ExecutionListener NOOP = new ExecutionListener() {}; diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanContext.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanContext.java index 84f616f..8a77dfe 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanContext.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanContext.java @@ -9,18 +9,43 @@ import java.util.List; */ public interface BeanContext { + /** + * Try to find a bean named name. + * + * @param name name. + * @param generic type + * @return bean + */ default T getBean(String name) { throw new UnsupportedOperationException(); } + /** + * Try to find a specified type bean named name. + * + * @param name name. + * @param generic type + * @param type specified type + * @return bean + */ default T getBean(String name, Class type) { throw new UnsupportedOperationException(); } + /** + * Try to find a specified type bean list. + * + * @param generic type + * @param type specified type + * @return bean list + */ default List getBean(Class type) { throw new UnsupportedOperationException(); } + /** + * Make cur bean ctx enabled. + */ default void init() { BeanUtils.init(this); } diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanUtils.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanUtils.java index 0b8b6a9..8d1f3eb 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanUtils.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/util/BeanUtils.java @@ -11,6 +11,17 @@ public class BeanUtils { private static BeanContext instance = null; + /** + * Init bean context. + * + * @param ctx bean context + */ + static void init(BeanContext ctx) { + instance = ctx; + } + + /* Static delegate methods */ + public static T getBean(String name) { return instance.getBean(name); } @@ -23,9 +34,4 @@ public class BeanUtils { List beans = instance.getBean(type); return beans != null && beans.size() > 0 ? beans.get(0) : null; } - - static void init(BeanContext ctx) { - instance = ctx; - } - } -- Gitee From a5e3c2c14346a1b5889721d6e3b4a538cf434657 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Wed, 11 Oct 2023 18:08:45 +0800 Subject: [PATCH 02/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=B8=AD=E6=96=AD=E7=9A=84listener?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- .../flow/core/ExecutionListeners.java | 22 +++++++++++++++++++ .../flow/core/invoker/WrappedInvoker.java | 8 +++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListeners.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListeners.java index 40dce38..42f88f6 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListeners.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/ExecutionListeners.java @@ -14,6 +14,13 @@ public class ExecutionListeners implements ExecutionListener { private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionListeners.class); + /** + * 记录中断流程的Listener + * + * @since 1.1.4 + */ + private static final ThreadLocal BROKEN = new ThreadLocal<>(); + private final List listeners; public ExecutionListeners(List listeners) { @@ -28,6 +35,15 @@ public class ExecutionListeners implements ExecutionListener { listeners.add(0, listener); } + public static ExecutionListener getBrokenListener() { + return BROKEN.get(); + } + + public static void remove() { + // Remove lastest broken listener. + BROKEN.remove(); + } + @Override public void start(EngineContext context) { for (ExecutionListener listener : listeners) { @@ -55,6 +71,12 @@ public class ExecutionListeners implements ExecutionListener { for (ExecutionListener listener : listeners) { try { listener.beforeExecute(context, object); + // Already broken. + if (context.isBroken()) { + BROKEN.set(listener); + return; + } + } catch (Throwable e) { LOGGER.warn("execute listener {} failed", listener.getClass().getName(), e); } diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/invoker/WrappedInvoker.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/invoker/WrappedInvoker.java index 332f75b..6547ce9 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/invoker/WrappedInvoker.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/invoker/WrappedInvoker.java @@ -2,6 +2,8 @@ package org.smartboot.flow.core.invoker; import org.smartboot.flow.core.Describable; import org.smartboot.flow.core.EngineContext; +import org.smartboot.flow.core.ExecutionListener; +import org.smartboot.flow.core.ExecutionListeners; import org.smartboot.flow.core.Feature; import org.smartboot.flow.core.component.Component; import org.smartboot.flow.core.component.PipelineComponent; @@ -19,16 +21,18 @@ public class WrappedInvoker { // 兼容ExecutionListener内部的主动broken调用 if (context.isBroken()) { + ExecutionListener brokenListener = ExecutionListeners.getBrokenListener(); int status = context.getExecuting(); context.setExecuting(EngineContext.EXECUTING); if (context.cfg().isConfigured(Feature.BrokenInListenerOnTree)) { - context.enter(Feature.BrokenInListenerOnTree.name()); - context.exit(Feature.BrokenInListenerOnTree.name()); + context.enter(Feature.BrokenInListenerOnTree.name() + "-" + brokenListener.describe()); + context.exit(Feature.BrokenInListenerOnTree.name() + "-" + brokenListener.describe()); } context.setExecuting(status); if (checkTraceable(component)) { context.exit(component, null); } + ExecutionListeners.remove(); return 0; } -- Gitee From d34b6253507666dbfb043dbc26b6a90e24dc72d0 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 24 Oct 2023 14:09:25 +0800 Subject: [PATCH 03/14] =?UTF-8?q?qinluo:=20=20=20=20=20=20-=20=E6=9B=B4?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E7=9A=84rollback=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/core/executable/ExecutableAdapter.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java index eb8d834..5c81f5b 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java @@ -3,6 +3,7 @@ package org.smartboot.flow.core.executable; import org.smartboot.flow.core.DegradeCallback; import org.smartboot.flow.core.EngineContext; +import org.smartboot.flow.core.Key; import org.smartboot.flow.core.Rollback; import org.smartboot.flow.core.common.ComponentType; import org.smartboot.flow.core.component.Component; @@ -34,6 +35,8 @@ public class ExecutableAdapter extends Component implements Rollback< @Override public int invoke(EngineContext context) { try { + // Record executed. + context.putExt(Key.of(this), true); executable.execute(context); } catch (Throwable e) { // 非降级,直接throw @@ -53,9 +56,15 @@ public class ExecutableAdapter extends Component implements Rollback< return 1; } + @Override + public boolean isRollbackable(EngineContext context) { + // Attribute 'rollback' configured and component has executed. + return super.isRollbackable(context) && context.getExt(Key.of(this)); + } @Override public void rollback(EngineContext context) { + context.remove(Key.of(this)); executable.rollback(context); } -- Gitee From 34615390321791781bbccc3d53efdea6e03a868a Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 24 Oct 2023 14:10:28 +0800 Subject: [PATCH 04/14] =?UTF-8?q?qinluo:=20=20=20=20=20=20-=20=E6=9B=B4?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E7=9A=84rollback=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/smartboot/flow/core/executable/ExecutableAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java index 5c81f5b..d91c70d 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/executable/ExecutableAdapter.java @@ -59,7 +59,7 @@ public class ExecutableAdapter extends Component implements Rollback< @Override public boolean isRollbackable(EngineContext context) { // Attribute 'rollback' configured and component has executed. - return super.isRollbackable(context) && context.getExt(Key.of(this)); + return super.isRollbackable(context) && context.getExt(Key.of(this)) != null; } @Override -- Gitee From c57215b83e60d1c31bf26a4ada0555b86c8c36c3 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 24 Oct 2023 15:21:03 +0800 Subject: [PATCH 05/14] =?UTF-8?q?qinluo:=20=20=20=20=20=20-=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/smartboot/flow/core/manager/ComponentModel.java | 7 +++++-- .../org/smartboot/flow/core/manager/PipelineModel.java | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/ComponentModel.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/ComponentModel.java index 8aef0c2..737c294 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/ComponentModel.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/ComponentModel.java @@ -44,7 +44,10 @@ public class ComponentModel extends Uniqueness { } else if (type != ComponentType.BASIC){ Map all = new HashMap<>(32); components.forEach((k, v) -> { - all.putAll(v.collect()); + Map collected = v.collect(); + if (collected != null) { + all.putAll(collected); + } all.put(v.getIdentifier(), v); }); @@ -52,7 +55,7 @@ public class ComponentModel extends Uniqueness { return all; } else { // Basic component. - return new HashMap<>(0); + return null; } } diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/PipelineModel.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/PipelineModel.java index 1022217..105d846 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/PipelineModel.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/manager/PipelineModel.java @@ -38,7 +38,10 @@ public class PipelineModel extends Uniqueness { HashMap collected = new HashMap<>(components.size()); for (ComponentModel model : components) { - collected.putAll(model.collect()); + Map subcollected = model.collect(); + if (subcollected != null) { + collected.putAll(subcollected); + } collected.put(model.getIdentifier(), model); } -- Gitee From f86a1037e62a5a0cba7e0d6df918293168c85da4 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 26 Oct 2023 14:48:15 +0800 Subject: [PATCH 06/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E5=BF=AB?= =?UTF-8?q?=E7=85=A7=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7=20=20=20=20=20-?= =?UTF-8?q?=20=E5=BC=95=E6=93=8E=E7=BB=93=E6=9E=84=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8E=8B=E7=BC=A9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- pom.xml | 4 ++-- smart-flow-admin/pom.xml | 4 ++-- smart-flow-core/pom.xml | 2 +- smart-flow-helper/pom.xml | 2 +- .../smartboot/flow/helper/view/XmlEngineVisitor.java | 11 +++++++++++ smart-flow-integration/pom.xml | 2 +- .../smart-flow-integration-nacos/pom.xml | 2 +- .../smart-flow-spring-extension/pom.xml | 2 +- .../smart-flow-springboot-starter/pom.xml | 2 +- smart-flow-manager/pom.xml | 2 +- .../java/org/smartboot/flow/manager/FlatManager.java | 1 + smart-flow-plugin/pom.xml | 2 +- smart-flow-plugin/smart-flow-bootstrap/pom.xml | 2 +- smart-flow-plugin/smart-flow-enhance-plugin/pom.xml | 2 +- smart-flow-script/pom.xml | 2 +- smart-flow-script/smart-flow-script-groovy/pom.xml | 2 +- smart-flow-script/smart-flow-script-ognl/pom.xml | 2 +- smart-flow-script/smart-flow-script-qlexpress/pom.xml | 2 +- 18 files changed, 30 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 6290330..a660727 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.smartboot.flow smart-flow-parent - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 pom smart-flow @@ -22,7 +22,7 @@ - 1.1.3 + 1.1.4-SNAPSHOT https://gitee.com/smartboot/smart-flow diff --git a/smart-flow-admin/pom.xml b/smart-flow-admin/pom.xml index 023f141..e9bf144 100644 --- a/smart-flow-admin/pom.xml +++ b/smart-flow-admin/pom.xml @@ -5,10 +5,10 @@ smart-flow-parent org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 - 1.1.3 + 1.1.4-SNAPSHOT smart-flow-admin diff --git a/smart-flow-core/pom.xml b/smart-flow-core/pom.xml index f7cf831..470ca3b 100644 --- a/smart-flow-core/pom.xml +++ b/smart-flow-core/pom.xml @@ -5,7 +5,7 @@ org.smartboot.flow smart-flow-parent - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-helper/pom.xml b/smart-flow-helper/pom.xml index 23c8f4e..1981ac7 100644 --- a/smart-flow-helper/pom.xml +++ b/smart-flow-helper/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java index d10a4fa..4cf9504 100644 --- a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java +++ b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java @@ -36,6 +36,12 @@ public class XmlEngineVisitor extends EngineVisitor { */ private String content; + private boolean compress; + + public void compressContent() { + this.compress = true; + } + public String getContent() { return content; } @@ -74,6 +80,11 @@ public class XmlEngineVisitor extends EngineVisitor { content.append("\n").append(END).append("\n"); this.content = content.toString(); + + if (compress) { + this.content = this.content.replace("\n", "") + .replace("\t", "").replace("\r\n", ""); + } } @Override diff --git a/smart-flow-integration/pom.xml b/smart-flow-integration/pom.xml index 4b1f46d..c94d3a9 100644 --- a/smart-flow-integration/pom.xml +++ b/smart-flow-integration/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-integration/smart-flow-integration-nacos/pom.xml b/smart-flow-integration/smart-flow-integration-nacos/pom.xml index aca2642..d8b390f 100644 --- a/smart-flow-integration/smart-flow-integration-nacos/pom.xml +++ b/smart-flow-integration/smart-flow-integration-nacos/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-integration/smart-flow-spring-extension/pom.xml b/smart-flow-integration/smart-flow-spring-extension/pom.xml index fb1a35e..d4afc67 100644 --- a/smart-flow-integration/smart-flow-spring-extension/pom.xml +++ b/smart-flow-integration/smart-flow-spring-extension/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-integration/smart-flow-springboot-starter/pom.xml b/smart-flow-integration/smart-flow-springboot-starter/pom.xml index 767f59a..5f3fe1b 100644 --- a/smart-flow-integration/smart-flow-springboot-starter/pom.xml +++ b/smart-flow-integration/smart-flow-springboot-starter/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-manager/pom.xml b/smart-flow-manager/pom.xml index 1247b5d..e57d584 100644 --- a/smart-flow-manager/pom.xml +++ b/smart-flow-manager/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-manager/src/main/java/org/smartboot/flow/manager/FlatManager.java b/smart-flow-manager/src/main/java/org/smartboot/flow/manager/FlatManager.java index fd9ba0f..4c055d0 100644 --- a/smart-flow-manager/src/main/java/org/smartboot/flow/manager/FlatManager.java +++ b/smart-flow-manager/src/main/java/org/smartboot/flow/manager/FlatManager.java @@ -42,6 +42,7 @@ public class FlatManager { engine.setReportContent(true); XmlEngineVisitor visitor = new XmlEngineVisitor(); + visitor.compressContent(); visitor.visit(source); String content = visitor.getContent(); engine.setContent(content); diff --git a/smart-flow-plugin/pom.xml b/smart-flow-plugin/pom.xml index b76abb4..aecbf22 100644 --- a/smart-flow-plugin/pom.xml +++ b/smart-flow-plugin/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-parent - 1.1.3 + 1.1.4-SNAPSHOT smart-flow-plugin diff --git a/smart-flow-plugin/smart-flow-bootstrap/pom.xml b/smart-flow-plugin/smart-flow-bootstrap/pom.xml index 9ffc1b6..c1304de 100644 --- a/smart-flow-plugin/smart-flow-bootstrap/pom.xml +++ b/smart-flow-plugin/smart-flow-bootstrap/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-plugin - 1.1.3 + 1.1.4-SNAPSHOT smart-flow-bootstrap diff --git a/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml b/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml index 2221700..916e55a 100644 --- a/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml +++ b/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-plugin - 1.1.3 + 1.1.4-SNAPSHOT smart-flow-enhance-plugin diff --git a/smart-flow-script/pom.xml b/smart-flow-script/pom.xml index af5a19d..8132650 100644 --- a/smart-flow-script/pom.xml +++ b/smart-flow-script/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 pom diff --git a/smart-flow-script/smart-flow-script-groovy/pom.xml b/smart-flow-script/smart-flow-script-groovy/pom.xml index 8febee5..bd81398 100644 --- a/smart-flow-script/smart-flow-script-groovy/pom.xml +++ b/smart-flow-script/smart-flow-script-groovy/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-script/smart-flow-script-ognl/pom.xml b/smart-flow-script/smart-flow-script-ognl/pom.xml index efd7c16..a409fab 100644 --- a/smart-flow-script/smart-flow-script-ognl/pom.xml +++ b/smart-flow-script/smart-flow-script-ognl/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 diff --git a/smart-flow-script/smart-flow-script-qlexpress/pom.xml b/smart-flow-script/smart-flow-script-qlexpress/pom.xml index 13519f0..d25deff 100644 --- a/smart-flow-script/smart-flow-script-qlexpress/pom.xml +++ b/smart-flow-script/smart-flow-script-qlexpress/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.3 + 1.1.4-SNAPSHOT 4.0.0 -- Gitee From 2368246de7245e519b56e20de14af4b2574c2b20 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 26 Oct 2023 15:54:55 +0800 Subject: [PATCH 07/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=BC=96=E8=BE=91=E7=9A=84=E8=A7=A3=E6=9E=90=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- .../flow/core/parser/ParseHelper.java | 174 ++++++++++++++++++ .../flow/helper/view/XmlEngineVisitor.java | 5 + 2 files changed, 179 insertions(+) create mode 100644 smart-flow-core/src/main/java/org/smartboot/flow/core/parser/ParseHelper.java diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/parser/ParseHelper.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/parser/ParseHelper.java new file mode 100644 index 0000000..bda819d --- /dev/null +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/parser/ParseHelper.java @@ -0,0 +1,174 @@ +package org.smartboot.flow.core.parser; + +import org.smartboot.flow.core.FlowEngine; +import org.smartboot.flow.core.attribute.AttributeValueResolver; +import org.smartboot.flow.core.util.AssertUtil; + +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * 更便捷的解析入口 + * + *
+ * {@code
+ *
+ * try {
+ *     DefaultParser parser = new DefaultParser();
+ *     parser.parse(this.getClass().getResourceAsStream("/engine.xml");
+ *     FlowEngine engine = parser.get("testEngine");
+ * } catch (Exception e) {
+ *
+ * }
+ * }
+ * 
+ * + * 可以简化为如下代码 + *
+ * {@code
+ * FlowEngine engine
+ *      = ParseHelper.classpath("engine.xml").get("testEngine");
+ *
+ * }
+ * 
+ * + * 或者(仅有一个引擎的情况下) + *
+ * {@code
+ * FlowEngine engine
+ *      = ParseHelper.classpath("engine.xml").unique();
+ *
+ * }
+ * 
+ * + * 当然也提供方法支持多个配置文件以及自定义解析器 + * + * @author qinluo + * @date 2023-10-26 15:00:41 + * @since 1.1.4 + */ +public final class ParseHelper { + + private static final int classpath = 1; + private static final int absolute = 2; + private static final int relative = 3; + + public static ParseHelperBuilder classpath(String config) { + return new ParseHelperBuilder(config, classpath); + } + + public static ParseHelperBuilder absolute(String config) { + return new ParseHelperBuilder(config, absolute); + } + + public static ParseHelperBuilder relative(String config) { + return new ParseHelperBuilder(config, relative); + } + + static InputStream getResource(String config, int type) { + try { + if (type == classpath) { + return ParseHelper.class.getResourceAsStream(config); + } else if (type == absolute || type == relative) { + return new FileInputStream(config); + } + } catch (Exception ignored) { + + } + + return null; + } + + public static class ParseHelperBuilder { + private final List streams = new ArrayList<>(0); + private final int type; + private boolean completed; + private final DefaultParser parser = new DefaultParser(); + private final InputStream mainStream; + + ParseHelperBuilder(String config, int type) { + this.type = type; + AssertUtil.notBlank(config, "config must not be blank"); + + InputStream stream = getResource(config, type); + AssertUtil.notNull(stream, "config " + config + " cannot found."); + this.mainStream = stream; + } + + private void addStream(String config, int type) { + InputStream stream = getResource(config, type); + AssertUtil.notNull(stream, "config " + config + " cannot found."); + this.streams.add(stream); + } + + private void processParse() { + if (!completed) { + parser.parse(mainStream, streams.toArray(new InputStream[0])); + } + completed = true; + } + + /* Engine scene. */ + + public FlowEngine unique() { + processParse(); + AssertUtil.isTrue(parser.getEngines().size() == 1, "Multiple engines."); + List engineNames = parser.getEngineNames(); + return parser.getEngine(engineNames.get(0)); + } + + public FlowEngine first() { + processParse(); + List engineNames = parser.getEngineNames(); + if (engineNames.size() > 0) { + return parser.getEngine(engineNames.get(0)); + } + return null; + } + + public FlowEngine get(String name) { + processParse(); + return parser.getEngine(name); + } + + + /* Customized Parser scene methods */ + public ParseHelperBuilder withObjectCreator(ObjectCreator creator) { + this.parser.setObjectCreator(creator); + return this; + } + + public ParseHelperBuilder withResolver(AttributeValueResolver resolver) { + this.parser.setAttributeValueResolver(resolver); + return this; + } + + public ParseHelperBuilder withScriptLocations(String ...locations) { + this.parser.scriptLoader().locations(locations); + return this; + } + + /* Special multiple config locations scene methods. */ + public ParseHelperBuilder addConfig(String config) { + this.addStream(config, type); + return this; + } + + public ParseHelperBuilder addClasspath(String config) { + this.addStream(config, classpath); + return this; + } + + public ParseHelperBuilder addAbsolute(String config) { + this.addStream(config, absolute); + return this; + } + + public ParseHelperBuilder addRelative(String config) { + this.addStream(config, relative); + return this; + } + } +} diff --git a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java index 4cf9504..0e96094 100644 --- a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java +++ b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java @@ -36,6 +36,11 @@ public class XmlEngineVisitor extends EngineVisitor { */ private String content; + /** + * 是否替换反序列化文本中的换行符、tab等多余空白 + * + * @since 1.1.4 + */ private boolean compress; public void compressContent() { -- Gitee From dfeee12136a7f08cf3d6c4a5acd9722721839f21 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Fri, 27 Oct 2023 16:00:35 +0800 Subject: [PATCH 08/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E7=BB=93=E6=9E=84=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- .../flow/helper/view/XmlEngineVisitor.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java index 0e96094..740ffe3 100644 --- a/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java +++ b/smart-flow-helper/src/main/java/org/smartboot/flow/helper/view/XmlEngineVisitor.java @@ -75,21 +75,30 @@ public class XmlEngineVisitor extends EngineVisitor { unprocessed = PipelineCollector.getUnprocessed(); } + // Avoid process script. + if (compress) { + this.content = this.content.replace("\n", "") + .replace("\t", "").replace("\r\n", ""); + } + Map> scripts = ScriptCollector.end(); if (scripts != null && scripts.size() > 0) { - scripts.forEach((k, v) -> content.append("\n\t")); + .append("\">").append("").append(""); + }); } - content.append("\n").append(END).append("\n"); - - this.content = content.toString(); - - if (compress) { - this.content = this.content.replace("\n", "") - .replace("\t", "").replace("\r\n", ""); + if (!compress) { + content.append("\n").append(END).append("\n"); + } else { + content.append(END); } + this.content = content.toString(); } @Override -- Gitee From e069f6579e3434b98f7445c27bd5352ba90b79da Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Fri, 27 Oct 2023 16:04:13 +0800 Subject: [PATCH 09/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=98=BB=E5=A1=9E=E5=B1=9E=E6=80=A7=EF=BC=9A=E9=98=BB?= =?UTF-8?q?=E5=A1=9E=E6=89=80=E6=9C=89=E5=BC=82=E6=AD=A5=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- .../org/smartboot/flow/core/Pipeline.java | 8 ++++++ .../flow/core/attribute/Attributes.java | 7 ++++++ .../builder/AbstractComponentBuilder.java | 1 + .../flow/core/component/Component.java | 25 +++++++++++++++++++ .../extension/BeanDefinitionVisitor.java | 5 ++++ .../spring/extension/SmartFlowRegistrar.java | 1 + .../SpringAttributeValueResolver.java | 25 +++++++++++++++++++ 7 files changed, 72 insertions(+) create mode 100644 smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SpringAttributeValueResolver.java diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/Pipeline.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/Pipeline.java index 429a1a6..b724065 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/Pipeline.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/Pipeline.java @@ -3,6 +3,7 @@ package org.smartboot.flow.core; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.smartboot.flow.core.attribute.Attributes; import org.smartboot.flow.core.component.Component; import org.smartboot.flow.core.invoker.InvokeListener; import org.smartboot.flow.core.invoker.WrappedInvoker; @@ -81,6 +82,13 @@ public class Pipeline implements Rollback, Describable, Validator, M } private void ensureAllDependsExecuted(Component component, EngineContext context) { + + // @since 1.1.4 ensure all async invoke has finished. + if (component.getAttributeValue(Attributes.DEPENDS_ALL, false)) { + context.ensureFinished(); + return; + } + for (String depends : component.getDependsOn()) { AsyncCallResult asyncCall = context.getAsyncCall(depends); if (asyncCall == null) { diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/attribute/Attributes.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/attribute/Attributes.java index 0290bdc..fceff07 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/attribute/Attributes.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/attribute/Attributes.java @@ -92,6 +92,13 @@ public enum Attributes { */ REFERENCED_PIPELINE("referenced-pipeline", "引用子流程", Boolean.class, false), + /** + * 是否等待所有异步组件完成 + * + * @since 1.1.4 + */ + DEPENDS_ALL("dependsAll", "等待前置的所有异步组件完成", Boolean.class), + ; private final String name; diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/builder/AbstractComponentBuilder.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/builder/AbstractComponentBuilder.java index de0c804..7a43ee5 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/builder/AbstractComponentBuilder.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/builder/AbstractComponentBuilder.java @@ -64,6 +64,7 @@ public abstract class AbstractComponentBuilder { */ protected void applyValues(Component component) { settings.forEach((k, v) -> k.apply(component, v)); + component.setValueResolver(valueResolver); } /** diff --git a/smart-flow-core/src/main/java/org/smartboot/flow/core/component/Component.java b/smart-flow-core/src/main/java/org/smartboot/flow/core/component/Component.java index c16b713..1b303a9 100644 --- a/smart-flow-core/src/main/java/org/smartboot/flow/core/component/Component.java +++ b/smart-flow-core/src/main/java/org/smartboot/flow/core/component/Component.java @@ -9,6 +9,8 @@ import org.smartboot.flow.core.Measurable; import org.smartboot.flow.core.Rollback; import org.smartboot.flow.core.Validator; import org.smartboot.flow.core.attribute.AttributeHolder; +import org.smartboot.flow.core.attribute.AttributeValueResolver; +import org.smartboot.flow.core.attribute.Attributes; import org.smartboot.flow.core.common.ComponentType; import org.smartboot.flow.core.visitor.ComponentVisitor; @@ -37,10 +39,18 @@ public abstract class Component extends AbstractExtensible implements Roll private String name; private boolean enabled = true; private DegradeCallback degradeCallback; + /** + * @since 1.1.4 + */ + private transient AttributeValueResolver valueResolver = AttributeValueResolver.getInstance(); protected final List attributes = new ArrayList<>(8); private volatile boolean validateCalled = false; + public void setValueResolver(AttributeValueResolver valueResolver) { + this.valueResolver = valueResolver; + } + public DegradeCallback getDegradeCallback() { return degradeCallback; } @@ -140,4 +150,19 @@ public abstract class Component extends AbstractExtensible implements Roll /** Returns component's type */ public abstract ComponentType getType(); + + /** + * 获取属性值 + * + * @since 1.1.4 + */ + public R getAttributeValue(Attributes attributes, R defaultValue) { + for (AttributeHolder ah : this.attributes) { + if (ah.getAttribute() == attributes) { + return (R)valueResolver.resolve(attributes.getAccept(), ah.getValue()); + } + } + + return defaultValue; + } } diff --git a/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/BeanDefinitionVisitor.java b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/BeanDefinitionVisitor.java index f1d9b80..b733438 100644 --- a/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/BeanDefinitionVisitor.java +++ b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/BeanDefinitionVisitor.java @@ -173,6 +173,7 @@ public class BeanDefinitionVisitor implements DefinitionVisitor, BeanFactoryAwar Attributes attribute = holder.getAttribute(); if (attribute == Attributes.NAME || attribute == Attributes.DEGRADE_CALLBACK + || attribute == Attributes.DEPENDS_ALL || !attribute.isVisible()) { continue; } @@ -392,6 +393,10 @@ public class BeanDefinitionVisitor implements DefinitionVisitor, BeanFactoryAwar PropertyValue name = new PropertyValue("name", ed.getName()); definition.setBeanClass(ed.resolveType()); definition.getPropertyValues().addPropertyValue(name); + + if (ed instanceof ComponentDefinition) { + definition.getPropertyValues().add("valueResolver", new RuntimeBeanReference(SpringAttributeValueResolver.class.getName())); + } return definition; } } diff --git a/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SmartFlowRegistrar.java b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SmartFlowRegistrar.java index 58d1724..91d9f36 100644 --- a/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SmartFlowRegistrar.java +++ b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SmartFlowRegistrar.java @@ -32,6 +32,7 @@ public class SmartFlowRegistrar implements ImportBeanDefinitionRegistrar { registeredClasses.put(SpringObjectCreator.NAME, SpringObjectCreator.class); registeredClasses.put(SpringBeanContextAdapter.NAME, SpringBeanContextAdapter.class); registeredClasses.put(XmlParseReloader.class.getName(), XmlParseReloader.class); + registeredClasses.put(SpringAttributeValueResolver.class.getName(), SpringAttributeValueResolver.class); } @Override diff --git a/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SpringAttributeValueResolver.java b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SpringAttributeValueResolver.java new file mode 100644 index 0000000..473cd46 --- /dev/null +++ b/smart-flow-integration/smart-flow-spring-extension/src/main/java/org/smartboot/flow/spring/extension/SpringAttributeValueResolver.java @@ -0,0 +1,25 @@ +package org.smartboot.flow.spring.extension; + +import org.smartboot.flow.core.attribute.AttributeValueResolver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; + +/** + * @author qinluo + * @date 2023-10-27 15:35:59 + * @since 1.1.4 + */ +public class SpringAttributeValueResolver extends AttributeValueResolver { + + @Autowired + private Environment environment; + + @Override + protected String earlyResolve(String value) { + try { + return environment.resolvePlaceholders(value); + } catch (Exception e) { + return value; + } + } +} -- Gitee From 947c761c9da6de768801527d76fa189e4a3aebbd Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 31 Oct 2023 20:00:59 +0800 Subject: [PATCH 10/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0xml=E7=BA=A6=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- smart-flow-core/src/main/resources/smart-flow-1.0.1.xsd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/smart-flow-core/src/main/resources/smart-flow-1.0.1.xsd b/smart-flow-core/src/main/resources/smart-flow-1.0.1.xsd index 0e38d95..f42e806 100644 --- a/smart-flow-core/src/main/resources/smart-flow-1.0.1.xsd +++ b/smart-flow-core/src/main/resources/smart-flow-1.0.1.xsd @@ -36,6 +36,14 @@ + + + + 等待所有前置异步组件完成 + + + + @@ -61,6 +69,7 @@ + -- Gitee From f0a5ea8e609f074c8a585e9f962401d17f76889f Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 16 Nov 2023 16:32:31 +0800 Subject: [PATCH 11/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E5=8C=85=20=20=20=20=20-=20docker=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- pom.xml | 4 ++-- smart-flow-admin/Dockerfile | 9 +++++++++ smart-flow-admin/pom.xml | 4 ++-- smart-flow-core/pom.xml | 2 +- smart-flow-helper/pom.xml | 2 +- smart-flow-integration/pom.xml | 2 +- .../smart-flow-integration-nacos/pom.xml | 2 +- .../smart-flow-spring-extension/pom.xml | 2 +- .../smart-flow-springboot-starter/pom.xml | 2 +- smart-flow-manager/pom.xml | 2 +- smart-flow-plugin/pom.xml | 2 +- smart-flow-plugin/smart-flow-bootstrap/pom.xml | 2 +- smart-flow-plugin/smart-flow-enhance-plugin/pom.xml | 2 +- smart-flow-script/pom.xml | 2 +- smart-flow-script/smart-flow-script-groovy/pom.xml | 2 +- smart-flow-script/smart-flow-script-ognl/pom.xml | 2 +- smart-flow-script/smart-flow-script-qlexpress/pom.xml | 2 +- 17 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 smart-flow-admin/Dockerfile diff --git a/pom.xml b/pom.xml index a660727..62bd142 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.smartboot.flow smart-flow-parent - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 pom smart-flow @@ -22,7 +22,7 @@ - 1.1.4-SNAPSHOT + 1.1.4 https://gitee.com/smartboot/smart-flow diff --git a/smart-flow-admin/Dockerfile b/smart-flow-admin/Dockerfile new file mode 100644 index 0000000..8ddca25 --- /dev/null +++ b/smart-flow-admin/Dockerfile @@ -0,0 +1,9 @@ +# syntax=docker/dockerfile:1 + +FROM openjdk:jdk-alpine3.8 + +WORKDIR /smart-flow-admin + +COPY target/smart-flow-admin-1.1.4.jar smart-flow-admin.jar + +CMD ["java", "-jar", "smart-flow-admin.jar"] \ No newline at end of file diff --git a/smart-flow-admin/pom.xml b/smart-flow-admin/pom.xml index e9bf144..cc2cdf3 100644 --- a/smart-flow-admin/pom.xml +++ b/smart-flow-admin/pom.xml @@ -5,10 +5,10 @@ smart-flow-parent org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 - 1.1.4-SNAPSHOT + 1.1.4 smart-flow-admin diff --git a/smart-flow-core/pom.xml b/smart-flow-core/pom.xml index 470ca3b..2a77ddb 100644 --- a/smart-flow-core/pom.xml +++ b/smart-flow-core/pom.xml @@ -5,7 +5,7 @@ org.smartboot.flow smart-flow-parent - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-helper/pom.xml b/smart-flow-helper/pom.xml index 1981ac7..f59da36 100644 --- a/smart-flow-helper/pom.xml +++ b/smart-flow-helper/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-integration/pom.xml b/smart-flow-integration/pom.xml index c94d3a9..e403b03 100644 --- a/smart-flow-integration/pom.xml +++ b/smart-flow-integration/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-integration/smart-flow-integration-nacos/pom.xml b/smart-flow-integration/smart-flow-integration-nacos/pom.xml index d8b390f..02a240b 100644 --- a/smart-flow-integration/smart-flow-integration-nacos/pom.xml +++ b/smart-flow-integration/smart-flow-integration-nacos/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-integration/smart-flow-spring-extension/pom.xml b/smart-flow-integration/smart-flow-spring-extension/pom.xml index d4afc67..36ae61c 100644 --- a/smart-flow-integration/smart-flow-spring-extension/pom.xml +++ b/smart-flow-integration/smart-flow-spring-extension/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-integration/smart-flow-springboot-starter/pom.xml b/smart-flow-integration/smart-flow-springboot-starter/pom.xml index 5f3fe1b..4e679ff 100644 --- a/smart-flow-integration/smart-flow-springboot-starter/pom.xml +++ b/smart-flow-integration/smart-flow-springboot-starter/pom.xml @@ -5,7 +5,7 @@ smart-flow-integration org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-manager/pom.xml b/smart-flow-manager/pom.xml index e57d584..d38f734 100644 --- a/smart-flow-manager/pom.xml +++ b/smart-flow-manager/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-plugin/pom.xml b/smart-flow-plugin/pom.xml index aecbf22..e7cc254 100644 --- a/smart-flow-plugin/pom.xml +++ b/smart-flow-plugin/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-parent - 1.1.4-SNAPSHOT + 1.1.4 smart-flow-plugin diff --git a/smart-flow-plugin/smart-flow-bootstrap/pom.xml b/smart-flow-plugin/smart-flow-bootstrap/pom.xml index c1304de..2cd06fa 100644 --- a/smart-flow-plugin/smart-flow-bootstrap/pom.xml +++ b/smart-flow-plugin/smart-flow-bootstrap/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-plugin - 1.1.4-SNAPSHOT + 1.1.4 smart-flow-bootstrap diff --git a/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml b/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml index 916e55a..8bb46b1 100644 --- a/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml +++ b/smart-flow-plugin/smart-flow-enhance-plugin/pom.xml @@ -6,7 +6,7 @@ org.smartboot.flow smart-flow-plugin - 1.1.4-SNAPSHOT + 1.1.4 smart-flow-enhance-plugin diff --git a/smart-flow-script/pom.xml b/smart-flow-script/pom.xml index 8132650..724eb07 100644 --- a/smart-flow-script/pom.xml +++ b/smart-flow-script/pom.xml @@ -5,7 +5,7 @@ smart-flow-parent org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 pom diff --git a/smart-flow-script/smart-flow-script-groovy/pom.xml b/smart-flow-script/smart-flow-script-groovy/pom.xml index bd81398..428aef5 100644 --- a/smart-flow-script/smart-flow-script-groovy/pom.xml +++ b/smart-flow-script/smart-flow-script-groovy/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-script/smart-flow-script-ognl/pom.xml b/smart-flow-script/smart-flow-script-ognl/pom.xml index a409fab..3e0cb22 100644 --- a/smart-flow-script/smart-flow-script-ognl/pom.xml +++ b/smart-flow-script/smart-flow-script-ognl/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 diff --git a/smart-flow-script/smart-flow-script-qlexpress/pom.xml b/smart-flow-script/smart-flow-script-qlexpress/pom.xml index d25deff..0c970b1 100644 --- a/smart-flow-script/smart-flow-script-qlexpress/pom.xml +++ b/smart-flow-script/smart-flow-script-qlexpress/pom.xml @@ -5,7 +5,7 @@ smart-flow-script org.smartboot.flow - 1.1.4-SNAPSHOT + 1.1.4 4.0.0 -- Gitee From b309e06f6bfa1942f339afa7880e3f5ae3da9548 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 16 Nov 2023 17:28:25 +0800 Subject: [PATCH 12/14] =?UTF-8?q?qinluo:=20=20=20=20=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinluo <1558642210@qq.com> --- smart-flow-admin/Dockerfile | 2 +- smart-flow-admin/Makefile | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 smart-flow-admin/Makefile diff --git a/smart-flow-admin/Dockerfile b/smart-flow-admin/Dockerfile index 8ddca25..c26dfe7 100644 --- a/smart-flow-admin/Dockerfile +++ b/smart-flow-admin/Dockerfile @@ -4,6 +4,6 @@ FROM openjdk:jdk-alpine3.8 WORKDIR /smart-flow-admin -COPY target/smart-flow-admin-1.1.4.jar smart-flow-admin.jar +COPY smart-flow-admin.jar smart-flow-admin.jar CMD ["java", "-jar", "smart-flow-admin.jar"] \ No newline at end of file diff --git a/smart-flow-admin/Makefile b/smart-flow-admin/Makefile new file mode 100644 index 0000000..d637f85 --- /dev/null +++ b/smart-flow-admin/Makefile @@ -0,0 +1,14 @@ +VERSION=1.1.4 +base: + mvn -f ../pom.xml clean install +init: + docker buildx create --use --name smartbuilder + docker buildx inspect smartbuilder --bootstrap +local: base + mvn clean package + cp /target/smart-flow-admin-*.jar smart-flow-admin.jar + docker build --no-cache -t smartboot/smart-flow-admin:${VERSION} -t smartboot/smart-flow-admin:latest . + rm -rf smart-flow-admin.jar + +clear: + docker buildx rm smartbuilder \ No newline at end of file -- Gitee From 94b5e8b12326a86eb2da02f0e4af19898248ae58 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 16 Nov 2023 17:29:01 +0800 Subject: [PATCH 13/14] qinluo: - makefile Signed-off-by: qinluo <1558642210@qq.com> --- smart-flow-admin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smart-flow-admin/Makefile b/smart-flow-admin/Makefile index d637f85..e76f8ec 100644 --- a/smart-flow-admin/Makefile +++ b/smart-flow-admin/Makefile @@ -6,7 +6,7 @@ init: docker buildx inspect smartbuilder --bootstrap local: base mvn clean package - cp /target/smart-flow-admin-*.jar smart-flow-admin.jar + cp target/smart-flow-admin-*.jar smart-flow-admin.jar docker build --no-cache -t smartboot/smart-flow-admin:${VERSION} -t smartboot/smart-flow-admin:latest . rm -rf smart-flow-admin.jar -- Gitee From 5b2148cd12c5d566eddaa693aa8fafb2267c0554 Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Thu, 16 Nov 2023 20:03:37 +0800 Subject: [PATCH 14/14] qinluo: - makefile Signed-off-by: qinluo <1558642210@qq.com> --- smart-flow-admin/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/smart-flow-admin/Makefile b/smart-flow-admin/Makefile index e76f8ec..395d4f2 100644 --- a/smart-flow-admin/Makefile +++ b/smart-flow-admin/Makefile @@ -8,6 +8,7 @@ local: base mvn clean package cp target/smart-flow-admin-*.jar smart-flow-admin.jar docker build --no-cache -t smartboot/smart-flow-admin:${VERSION} -t smartboot/smart-flow-admin:latest . + docker buildx build --no-cache -t smartboot/smart-flow-admin:${VERSION} -t smartboot/smart-flow-admin:latest . --platform=linux/amd64,linux/arm64 . --push rm -rf smart-flow-admin.jar clear: -- Gitee