LiteFlow LiteFlow
💒Home
📚Documents
💖Donation
🚀Plugin
  • About LiteFlow
  • Update Record
Community
Users
Gitee (opens new window)
Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
💒Home
📚Documents
💖Donation
🚀Plugin
  • About LiteFlow
  • Update Record
Community
Users
Gitee (opens new window)
Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
  • 🍤Introduction
  • 🍓Features
  • 🍟Quick Start(Hello world)

    • 🍄Notice
    • 🌿Springboot environment

      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
    • 🌱Spring environment

      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
    • 🌵Other environment

      • 🍄Notice
      • 🧬Dependency
      • ⚙️Config
      • 🛫Execute
  • 🍢Configuration item

    • 🍄Notice
    • 🌿Springboot environment
    • 🌱Spring environment
    • 🌵Other environment
  • 🗂Rules file

    • 📔Rules file format
    • 📕Local rule file
    • 📗Zookeeper source
    • 📘SQL database source
    • 📋Nacos source
    • 🗄Etcd source
    • 📙Custom source
      • 说明
      • Configuration path
  • 🔗General components

    • 📎Common component
    • ✂️Switch component
    • 📌If component
    • 🧬For component
    • ⛓While component
    • 🧿Break component
  • 🧩How to write EL rules

    • 🍄Notice
    • 🌴Serial mode
    • 🎋Parallel mode
    • 🌾Switch mode
    • 🌵If mode
    • 🌳Loop mode
    • 🍁Use sub chain
    • 🍂Use sub variables
    • 💐Complex example
    • 🌻About semicolons
    • 🌰About comments
    • 🐚Component Name Package
  • 🌮Data context

    • 🍄Notice
    • 🌯Definition and use
    • 🪶Pass initialized context
  • 🛩Flow executor

    • 🍄Notice
    • 🎡Executor method
    • 🎢Chain input parameter
    • 🎈LiteflowResponse object
  • 🍋Script component

    • 🍫Choose a script language
    • 🍕Define script component
    • 🌯Define file script
    • 🍣Interact with java
    • 🍘Dynamic refresh script
  • 🍇Declarative component

    • 🥭What is a declarative component
    • 🧅Class level declaration
    • 🥥Method level declaration
  • 🎲Dynamic rules

    • 🍄Notice
    • 🎯How to build
  • 🎨Advanced features

    • 🍒Pre & Finally components
    • 🥠Substitute component
    • 🍉Component Parameters
    • 🍑Component alias
    • 🍍Component tag
    • 🥝Component event
    • 🥑Implicit chain
    • 🍕Private delivery
    • 🍣Component retry
    • 🍖Smooth hot refresh
    • 🍪Component aspect
    • 🍡Step information
    • 🧊Exceptions
    • 🧇Printing details
    • 🧁Custom request id
    • 🌭Multiple type rules
    • 🥗Asynchronous thread pool
    • 🍿Custom component executor
    • 🍥Simple monitor
    • 🧉DTD in Xml
  • ⛱Test cases and demo

    • 🪁Test cases
    • 🪀Demo
  • 🪂Performance
  • v2.9.X文档
  • 🗂Rules file
铂赛东
2022-06-07
Contents

📙Custom source

# 说明

If you don't want to use the local configuration, and don't plan to use zk as the configuration source. LiteFlow supports extension points for custom configuration sources.

Rule files in XML form, please inherit ClassXmlFlowELParser

For rule files in JSON format, please inherit ClassJsonFlowELParser

For rule files in YML format, please inherit ClassYmlFlowELParser

The following is an example of a custom source configuration class in XML form:

public class TestCustomParser extends ClassXmlFlowELParser {

	@Override
	public String parseCustom() {
		System.out.println("进入自定义parser");
		String xmlContent = null;
		//Here you need to extend it yourself to get the configuration from a custom place
		return xmlContent;
	}
}

tip one

The custom configuration source class is also automatically injected into the spring context, so you can freely inject beans in the spring context in this class, you can use annotation such as @Autowired and @Resources

tip two

The custom configuration source implementation class requires you to return all the configuration file text content. This also means that if you store in a database, you store all the rules file text.

If you want to store the rule details in the database instead of the entire rule text, please refer to the Dynamic rules chapter.

# Configuration path

The following uses the configuration of Springboot as an example. For the configuration of Spring and non-Spring environments, you can read the Configuration Items chapter in detail.

You just need to change rule-source to the class of your custom rule configuration source

liteflow.rule-source=el_xml:com.yomahub.liteflow.test.TestCustomParser

About the el_xml tag header

LiteFlow not only supports xml configuration, but also json and yml configuration. The beginning of el_xml: indicates that the content read here is the configuration in xml and parsed in EL. Please read the Rule File Format chapter for details about the supported format of the rule file.

Help us improve this document (opens new window)
last update: 2022/10/13, 00:02:27
🗄Etcd source
📎Common component

← 🗄Etcd source 📎Common component→

Theme by Vdoing | Copyright © 2020-2022 铂赛东 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式