Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in EPL | Defining What Happens When Matching Events Are Found | Defining conditional logic with the if statement
Defining conditional logic with the if statement
EPL supports conditional if and if ... else statements.
An if statement is followed by a boolean expression followed by an optional then keyword followed by a block. A block consists of one or more statements enclosed in curly braces, { }. If the boolean expression is true, the contents of the block are executed.
The boolean expression must evaluate to the boolean values true or false.
The if statement can be optionally followed by an else keyword and a second block. This second block is executed if the boolean expression is false. Instead of the else block, a single if statement, not enclosed in braces, may be used.
EPL example:
if floatVariable > 5.0 {
integerVariable := 1;
} else if floatVariable < -5.0 {
      integerVariable := -1;
} else {
      integerVariable := 0;

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.