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
  • 🔗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文档
  • 🎨Advanced features
铂赛东
2022-07-27

🥠Substitute component

If you write a component that does not exist in the project, it will usually report an error.

For example, only three components A, B, and C are defined in your system. But you write this in the rule:

<chain name="chain1">
    THEN(A, B, C, D);
</chain>

Since the D component does not exist, an error will be reported at startup.

The meaning of the substitute component is that when you write a component that does not exist, it will automatically resolve to the component you specified during parsing, and the substitute component will replace the non-existing component to execute, so that no error will be reported.

You need to specify your substitute component in the config:

liteflow.substitute-cmp-class=com.yomahub.liteflow.test.substituteNode.cmp.SubCmp

Substitute components are no different from other components.

After you specify the substitute components, your rules file needs to be written like this:

<chain name="chain1">
    THEN(A, B, C, node("D"));
</chain>

tip

If the node keyword is not added, it will not be automatically routed to the substitute component, so it must be added.

Help us improve this document (opens new window)
last update: 2022/10/13, 00:02:27
🍒Pre & Finally components
🍉Component Parameters

← 🍒Pre & Finally components 🍉Component Parameters→

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