Files
liteFlow/docs/runwithcustom.md
bryan.zhang 3237cd1e87 更新文档
2018-02-28 19:09:47 +08:00

29 lines
909 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 使用自定义的配置源
如果你不想用本地的配置也不打算使用zk作为配置持久化工具。liteFlow支持自定义的配置源的扩展点。
# 创建自定义配置源的类
在你的项目中创建一个类继承`ClassXmlFlowParser`这个类
```java
public class TestCustomParser extends ClassXmlFlowParser {
@Override
public String parseCustom() {
System.out.println("进入自定义parser");
String xmlContent = null;
//这里需要自己扩展从自定义的地方获取配置
return xmlContent;
}
}
```
# spring配置
spring中需要改的地方还是执行器的配置只需要在配置的路径地方放入自定义类的类路径即可
```xml
<bean id="flowExecutor" class="com.thebeastshop.liteflow.core.FlowExecutor">
<property name="rulePath">
<list>
<value>com.thebeastshop.liteflow.test.TestCustomParser</value>
</list>
</property>
</bean>
```