Altova FlowForce Server 2023 Advanced Edition

In some cases, you may want FlowForce Server to process steps conditionally. In this case, add a Choose step. Such steps consist of two parts: a When part and an Otherwise part (see diagram below).


After Step B has been executed, Step C or D will be executed, depending on the When expression. If the When expression returns the Boolean true, Step C will be executed. Otherwise, Step D will be executed. After Step C or D has been executed, the job proceeds to Step E and then Step F.



The examples below will show you how to handle conditional steps. The jobs illustrated on this page use FlowForce expressions.


Example 1

In the step illustrated below, FlowForce will execute the built-in delete function only if the fileexists expression returns the Boolean true. Note that the fileexists expression must be declared in the previous step (e.g., as an input parameter); otherwise, a validation error will occur.



Example 2

If you intend to pass the result of a Choose step to another step or declare the result to be of a particular type, ensure that each When and Otherwise condition has the same return type. Otherwise, validation errors might occur. For example, consider a job that checks the value of a numeric parameter temperature that defines whether the weather is hot or normal (see screenshot below).


In the Execution Result section, Declare return type as is set to string. If the temperature is greater than 35, the string expression It is hot is computed. Otherwise, the string expression It is normal is computed. In our sample job, both the When and Otherwise conditions return strings. Therefore, the job can be successfully saved and executed. However, if the Otherwise condition stays empty, the string expression will not be computed, and the job will cause a validation error.



© 2016-2022 Altova GmbH