🥠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.