📌If component
Starting from version 2.8.5, LiteFlow provides the definition of conditional components.
Conditional components can also be called IF components, and the return is a true/false. Can be used for keywords such as IF...ELIF...ELSE
.
For the usage of IF...ELIF...ELSE
expressions, please refer to the chapter If mode.
For example, an IF with three arguments, as shown below, x is the IF component, if true, execute a, if false, execute b:
<chain name="chain1">
IF(x, a, b);
</chain>
The definition of the x node needs to inherit the NodeIfComponent
class:
@Component("x")
public class XCmp extends NodeIfComponent {
@Override
public boolean processIf() throws Exception {
//do your biz
return true;
}
}
See the chapter Common Components for the methods that can be overridden and the methods that can be called by the this keyword.
Help us improve this document (opens new window)
last update: 2022/10/13, 00:02:27