更新文档

This commit is contained in:
bryan.zhang
2018-02-28 19:09:47 +08:00
parent a19a4d521f
commit 3237cd1e87
5 changed files with 87 additions and 4 deletions

0
docs/.nojekyll Normal file
View File

74
docs/README.md Normal file
View File

@@ -0,0 +1,74 @@
### 概述
liteFlow是一个轻量快速的组件式流程框架帮助解耦业务代码让每一个业务片段都是一个组件
* 提供本地xml的流程配置后续全面支持spring式流程配置
* 提供基于spring的扫描方式注入component
* 提供串行和并行2种模式。
* 消除组件之间参数传递,引入数据总线概念。
* 数据槽高并发隔离机制。
* 提供无级嵌套条件节点的模式。
* 自带简单的监控能够知道每个组件的运行耗时排行每隔5分钟会自动打印
### 最新版本1.3.1更新日志
优化大量潜在的问题,此版本为稳定版本,主要更新点如下:
1. 增加条件节点功能
2. 优化异常捕获的日志打印
3. 支持自定义SLOT的特性
4. 优化步骤打印,能够支持开闭区间的打印方式
5. 增加了内部策略的调用方式
6. 增加了追踪ID
7. 优化了监控打印
### Quick Start
1. 定义组件需继承Component项目启动时会被自动发现。
2. 定义xml配置(例子)
```xml
<?xml version="1.0" encoding="UTF-8"?>
<flow>
<!-- 如果和spring集成以下<nodes>配置可以不要 -->
<nodes>
<node id="a" class="com.thebeastshop.liteflow.test.component.AComponent"/>
<node id="b" class="com.thebeastshop.liteflow.test.component.BComponent"/>
<node id="c" class="com.thebeastshop.liteflow.test.component.CComponent"/>
<node id="d" class="com.thebeastshop.liteflow.test.component.DComponent"/>
<node id="e" class="com.thebeastshop.liteflow.test.component.EComponent"/>
<node id="f" class="com.thebeastshop.liteflow.test.component.FComponent"/>
<node id="g" class="com.thebeastshop.liteflow.test.component.GComponent"/>
</nodes>
<chain name="chain1">
<then value="a,c"/> <!-- then代表串行 -->
<when value="b,d"/> <!-- when代表并行 -->
<then value="e,f,g"/>
</chain>
<chain name="chain2">
<then value="a,cond(b|d)"/> <!-- cond节点是条件节点根据cond节点路由到b节点或者d节点 -->
<then value="e,f,g"/>
</chain>
<chain name="chain3">
<then value="a,c,g"/>
<when value="b,e"/>
<then value="d,f"/>
</chain>
</flow>
```
3.spring里声明执行器
```xml
<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor" init-method="init">
<property name="rulePath">
<list>
<value>flow.xml</value>
</list>
</property>
</bean>
<!-- 自动扫描注入到spring的component组件 -->
<bean class="com.thebeastshop.liteflow.spring.ComponentScaner"/>
```
4.开始一个流程
```java
executor.execute("chain2", 参数);
```

View File

@@ -1 +1,9 @@
###
## 架构设计
![architecture_image](images/architecture.png)
组件式流程引擎架构设计
Handler Unit我们想象成每一个业务都是一个业务组件每一个业务组件就是一个handlerUnit处理单元
EPU这里的epu对应的就是我们的执行器用来统筹并处理handlerUnit。相当于计算机的CPU
Event Bus事件总线用来指定下一个命令是什么该如何去执行处理单元。这里的时间总线由我们的配置构成
Data Bus数据总线用来存储整个调用链里数据。每一个请求生成一个数据槽。一个数据里最多有1024个数据槽。

1
docs/guide.md Normal file
View File

@@ -0,0 +1 @@
XXX

View File

@@ -1,7 +1,7 @@
## 使用自定义的方式配置
如果你不想用本地的配置也不打算使用zk作为配置持久化工具。liteFlow支持自定义的配置的扩展点。
## 使用自定义的配置
如果你不想用本地的配置也不打算使用zk作为配置持久化工具。liteFlow支持自定义的配置的扩展点。
# 创建自定义配置的类
# 创建自定义配置的类
在你的项目中创建一个类继承`ClassXmlFlowParser`这个类
```java
public class TestCustomParser extends ClassXmlFlowParser {