LiteFlow v2.11.1 released! A new generation rule engine with high-speed iteration and active community

Introduction to LiteFlow

LiteFlow is an open source orchestration rule engine that allows you to arrange your system logic arbitrarily. You can use scripts to write logic. It supports up to 6 scripting languages ​​and supports rich third-party storage support. All logic and rules can be hot-changed. . An artifact for designing and refactoring systems.

LiteFlow is Gitee's high-star project and has maintained a very fast growth trend over the past year.

At the same time, LiteFlow is also an excellent community-driven open source project in China. It has been open source for nearly three years and has been used in core systems by major companies. Features and support are very good. The community has more than 3,500 people. There are 1,500 test cases, and the quality is guaranteed.

If this is the first time you know about this project, you can go to the official website or related homepage to learn more:

Project official website:

https://liteflow.cc

gitee managed repository:

https://gitee.com/dromara/liteFlow

Github hosted warehouse:

https://github.com/dromara/liteflow

Preface

The last version was released on September 1st. After a month and a half, LiteFlow's new v2.11.1 is available to everyone.

This version brings a total of 7 major features, 3 enhancements, and 2 fixes. A total of 12 issue updates.

In fact, this is already better than the previous major version.

All this is due to the LiteFlow team members, who contributed many features in this version, thank them. Especially in this version, two new members have joined the team. Currently, there are 11 team members. The next iteration will become even faster.

We ensure that while new features are being rolled out, the quality of the projects is also outstanding. As of the new version of LiteFlow, there are a total of 1,515 test cases. For every feature submitted, each of our members will pass the test cases. This is also the confidence we have every time we release a version. We take the test cases seriously. And our test case code line coverage has reached a very high 90% coverage.

In fact, to be fair, in open source projects with more than 1,500 test cases, 90% line coverage is considered an excellent level.

SQL plug-in supports polling auto-update mode

LiteFlow supports storing rules and scripts in any relational database. Since relational databases do not push changes like registration centers, developers have been required to manually refresh rules and scripts when they change in the database. . And each application instance needs to be refreshed. This is a bit cumbersome for developers.

So we launched the database automatic polling update mode in v2.11.1. All this needs to be added to your original configuration:

liteflow:
  rule-source-ext-data-map:
    ...
    #是否开启SQL数据轮询自动刷新机制 默认不开启
    pollingEnabled: true
    ...

By default, LiteFlow will compare SHA values ​​every 1 minute to determine whether it needs to be updated.

Please refer to the specific usage method 规则文件->SQL数据库配置源.

WHEN adds must syntax

WHENThe syntax has been introduced before any, which means that when any one is completed, continue and ignore the others. However, some friends in the community have encountered real scenarios where they need to complete the specified nodes first and ignore others in asynchronous parallelism.

For this reason, a new mustsyntax has been introduced in this new version to provide more diversity in parallel orchestration.

<chain name="chain1">
    THEN(
        a,
        WHEN(b, c, d).must(b, c),
        f
    );
</chain>

You can also specify one or more expressions:

<chain name="chain1">
    THEN(
        a,
        WHEN(b, THEN(c, d).id("t1"), e).must(b, "t1"),
        f
    );
</chain>

Please refer to the specific usage method EL规则的写法->并行编排->指定任意节点先执行完则忽略其他.

Introducing dynamic assembly API for EL expressions

LiteFlow previously launched an API for dynamically building chains, similar to this:

LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(
  "THEN(a, b, WHEN(c, d))"
).build();

However, the EL expression still needs to be filled in by yourself in the form of a string, which is not truly dynamic.

This time we have launched a new dynamic assembly API for EL expressions. For the above EL, you can dynamically build it as follows:

ThenELWrapper el = ELBus.then(
    "a","b",ELBus.when("c", "d")
);
LiteFlowChainELBuilder.createChain().setChainName("chain1").setEL(el.toEL()).build();

It is worth mentioning that constructing EL expressions in Java language is almost exactly the same as EL writing. If you are already familiar with LiteFlow's rule syntax, you should be able to get started at no cost.

Currently the API supports all EL syntax. Please refer to the specific usage method 用代码构造规则->构造EL.

link inheritance

Each LiteFlow chain is independent, and there is no inheritance relationship in previous versions. But in this new version, we introduced the link inheritance feature.

Just like class inheritance, links can be inherited. For business systems with complex links, the links can be abstracted to obtain a very elegant expression.

The inheritance we defined is also very easy to understand:

<chain id="base">
    THEN(a, b, {0}, {1});
</chain>

<chain id="implA" extends="base">
    {0}=IF(c, d, e);
    {1}=SWITCH(f).to(j,k);
</chain>

Multi-level inheritance is also possible:

<chain id="base">
    THEN(a, b, {0}, {1});
</chain>

<chain id="base2" extends="base">
  {0}=THEN(a,b,{3});
  {1}=SWITCH(f).to({4},k);
</chain>

<chain id="implB" extends="base2">
  {3}=THEN(a,b);
  {4}=j;
</chain>

If you have this scenario, you might as well try the inheritance feature.

Please refer to the specific usage method 高级特性->链路继承.

Component downgrade

LiteFlow's previous 替补组件comprehensive upgrades into 组件降级features.

Component downgrade allows you to define downgraded components for each type of component. The new version provides @FallbackCmpannotations for definition.

In EL rules, if you wrap nodea component with keywords, you enable the downgrade feature:

<chain id="chain1">
    THEN(node("a"), b, c);
</chain>

When a component does not exist, it will go to @FallbackCmpthe downgraded component defined with annotations.

Please refer to the specific usage 高级特定->组件降级.

Supports fuzzy matching of absolute paths

LiteFlow has long supported fuzzy matching of rule files within the project. However, previous versions have not supported fuzzy matching of absolute paths.

We support this version.

You can use *or **to fuzzy match multiple levels of files with any name:

liteflow.rule-source=/data/lf/**/*Rule.xml

If the file monitoring function is turned on, each file matched by the fuzzy path can also be monitored. When the file changes, the automatic refresh function is implemented. Isn't that cool.

For specific usage, please refer to 规则文件->本地规则文件配置and 高级功能->本地文件监听.

WHEN thread pool isolation

LiteFlow has introduced a new configuration in v2.11.1. When executing parallel components in WHEN, the thread pool of each when is isolated. This feature is very useful when running complex nested WHEN links. It can effectively improve the running speed and avoid deadlock problems.

You only need to enable this configuration, it is turned off by default.

liteflow.when-thread-pool-isolate=true

Please refer to the specific usage EL规则的写法->并行编排->开启WHEN线程池隔离.

Full list of updates

特性 #I7Y0Y1 SQL插件支持轮询模式

https://gitee.com/dromara/liteFlow/issues/I7Y0Y1

特性 #I7XAIB WHEN增加must语法

https://gitee.com/dromara/liteFlow/issues/I7XAIB

特性 #I878WV EL表达式动态组装

https://gitee.com/dromara/liteFlow/issues/I878WV

特性 #I7SVZF 支持chain的继承关系特性

https://gitee.com/dromara/liteFlow/issues/I7SVZF

特性 #I7YYLF 组件降级特性

https://gitee.com/dromara/liteFlow/issues/I7YYLF

特性 #I7ZJRH 支持绝对路径的模糊匹配

https://gitee.com/dromara/liteFlow/issues/I7ZJRH

特性 #I883LB when线程池隔离支持

https://gitee.com/dromara/liteFlow/issues/I883LB

增强 #I821F1 检测链路的循环依赖问题

https://gitee.com/dromara/liteFlow/issues/I821F1

增强 #I7G6BB 自定义异步线程池初始化存在并发问题

https://gitee.com/dromara/liteFlow/issues/I7G6BB

增强 #I855YM sql 插件重构

https://gitee.com/dromara/liteFlow/issues/I855YM

修复 #I82M4G 回滚组件无法获得tag的问题

https://gitee.com/dromara/liteFlow/issues/I82M4G

修复 #I7ZMVM 普通组件isContinueOnError和isEnd为true时,process直接抛异常会导致isEnd失效

https://gitee.com/dromara/liteFlow/issues/I7ZMVM

How to join a group

LiteFlow's community group already has about 3,000 people. If you have any questions, you can ask in the group.

For how to join a group, please refer to: https://liteflow.cc/pages/73c2c3/

Guess you like

Origin www.oschina.net/news/261886/liteflow-2-11-1-released