From d706c15355ef073c5352a55e2204991ef7b13a55 Mon Sep 17 00:00:00 2001 From: "bryan.zhang" Date: Tue, 7 Jul 2020 13:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A4=BA=E4=BE=8B=E7=9A=84=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E5=92=8C=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide_cn.md | 58 ++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/docs/guide_cn.md b/docs/guide_cn.md index 853d27fbb..75fabf754 100644 --- a/docs/guide_cn.md +++ b/docs/guide_cn.md @@ -72,11 +72,38 @@ Slot slot = executor.execute("demoChain", "arg"); 如果你的项目使用spring,推荐参考[和Spring进行集成](https://bryan31.gitee.io/liteflow/#/?id=%e4%ba%8c%e3%80%81%e5%92%8cspring%e8%bf%9b%e8%a1%8c%e9%9b%86%e6%88%90) -# 二.和spring进行集成 +# 二.和Spring Boot集成 + +## 2.1 依赖 + +liteFlow提供了liteflow-spring-boot-starter依赖包,提供自动装配功能 + +```xml + + com.yomahub + liteflow-spring-boot-starter + 2.2.2 + +``` + +## 2.2配置 + +在依赖了以上jar包后。 + +在application.properties里加上配置地址后,就可以在容器中依赖拿到`FlowExecutor`实例 + +```properties +liteflow.ruleSource=config/flow.xml +``` + +工程中的liteflow-test演示了如何在springboot下进行快速配置 + +# 三.和spring进行集成 针对于使用了spring但没有使用springboot的项目 -## 2.1流程配置可以省略的部分 +## 3.1流程配置可以省略的部分 + 流程配置中的`nodes`节点,可以不用配置了,支持spring的自动扫描方式。你需要在你的spring配置文件中定义 ```xml @@ -96,7 +123,8 @@ public class AComponent extends NodeComponent } ``` -## 2.2spring中执行器的配置 +## 3.2spring中执行器的配置 + ```xml @@ -108,31 +136,7 @@ public class AComponent extends NodeComponent ``` 然后你的项目中通过spring拿到执行器进行调用流程。 -# 三.和Spring Boot集成 -## 3.1 依赖 - -liteFlow提供了liteflow-spring-boot-starter依赖包,提供自动装配功能 - -```xml - - com.yomahub - liteflow-spring-boot-starter - 2.2.2 - -``` - -## 3.2配置 - -在依赖了以上jar包后。 - -在application.properties里加上配置地址后,就可以在容器中依赖拿到`FlowExecutor`实例 - -```properties -liteflow.ruleSource=config/flow.xml -``` - -工程中的liteflow-test演示了如何在springboot下进行快速配置 # 四.和zookeeper进行集成