Introduction to Liteflow Rule Engine: Architecture, Components, Configuration, and Business Use Cases

This article introduces the Liteflow rule engine, detailing its architecture, component types, Maven and YAML configuration, example XML rule definitions, and a real‑world e‑commerce workflow, while also promoting related AI tools and services.

Top Architect
Top Architect
Top Architect
Introduction to Liteflow Rule Engine: Architecture, Components, Configuration, and Business Use Cases

In daily development, serial and parallel business processes often need coordination without direct correlation; using a rule engine like Liteflow can address this need efficiently.

Liteflow is a lightweight yet powerful rule engine that can be used out‑of‑the‑box with Spring Boot, MyBatis Plus, Vue & Element, supporting multiple rule file formats (XML, JSON, YAML) and storage options such as SQL, Zookeeper, Nacos, or Apollo.

<dependency>
  <groupId>com.yomahub</groupId>
  <artifactId>liteflow-spring-boot-starter</artifactId>
  <version>2.10.6</version>
</dependency>

Liteflow’s architecture consists of a flow executor, data context for parameter passing, and node components. Node types include ordinary components (implementing NodeComponent), switch components (extending NodeSwitchComponent), and conditional components (extending NodeIfComponent), each supporting custom business logic and error handling.

Configuration is performed via YAML, for example:

liteflow:
  ruleSource: liteflow/*.el.xml
  retry-count: 0
  print-execution-log: true
  monitor:
    enable-log: true
    period: 300000
  request-id-generator-class: com.platform.orderserver.config.AppRequestIdGenerator
  slot-size: 10240
  main-executor-works: 64
  when-max-wait-seconds: 15
  when-max-workers: 16
  when-queue-limit: 5120
  parse-on-start: true
  enable: true

Example XML rule files illustrate serial composition ( THEN(a, b, c)), parallel composition ( WHEN(a, b, c)), switch logic ( SWITCH(a).to(b, c)), and conditional execution ( THEN(IF(x, a), b)).

A practical e‑commerce scenario demonstrates a flow where, after an order is completed, points are granted, a message is sent, and email and SMS notifications are dispatched in parallel, showcasing Liteflow’s ability to orchestrate complex business processes.

The article also contains promotional sections advertising AI products, paid courses, community groups, and related services, encouraging readers to join and purchase these offerings.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javarule engineworkflowBackend DevelopmentConfigurationSpring Boot
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.