
Title
Page icon
Create new category
Edit page index title
Edit category
Edit link
Condition
Condition is a command which contains some expression and returns boolean result. This result can be used in any other command as a condition whether to execute the command or skip it's execution.
<condition>
Required parameters:
comment
name - string
spel - string, expression
We are using Spring Expression Language (SpEL) to create a boolean expression, so we highly recommend to familiarize with their documentation.
Usage example:
We have a variable which will get the amount of "History of Time" books we have in our stock.
This condition will check if HOT_AMOUNT value will be lower then the certain threshold, and if it is not, then the step with this condition won't be executed.
In "condition" filed you need to insert the name of <condition> command.
If condition value=true, then <mysql> command will be executed, if 'false', then it will be skipped.
AND operator which syntactically looks like && . The use of this operator means that in order to perform the step, the both operands (conditions) combined by this operator must be true.
OR operator which syntactically looks like || . The use of this operator means that in order to perform a step, one of the operands (conditions) combined by this operator must be true.
Usage example: we have two conditions, one of which is true, the other is false.
Let's consider an example of using these conditions using AND and OR operators:
In the first case, when using the "TRUE" and "FALSE" conditions and the "&&" operator, the step will not be executed for the reason that the result of the Boolean expression "true AND false" will be FALSE.
In the second case, when using the "TRUE" and "FALSE" conditions and the "||" operator, the step will be executed for the reason that the result of the Boolean expression "true OR false" will be TRUE.
It is possible to use AND and OR operators at the same time:
It is also possible to use Boolean expressions instead of separately created conditions. The example below uses the boolean expression "1 == 1":
Copyright © Knubisoft