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:

  1. comment
  2. name - string
  3. 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.

XML
Copy

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.

XML
Copy

In "condition" filed you need to insert the name of <condition> command.

XML
Copy

If condition value=true, then <mysql> command will be executed, if 'false', then it will be skipped.

  1. AND operator which syntactically looks like &amp;&amp; . The use of this operator means that in order to perform the step, the both operands (conditions) combined by this operator must be true.
  2. 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.

XML
Copy

Let's consider an example of using these conditions using AND and OR operators:

XML
Copy

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:

XML
Copy

It is also possible to use Boolean expressions instead of separately created conditions. The example below uses the boolean expression "1 == 1":

XML
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
On This Page
Condition<condition>