Developing Apama Applications > Apama EPL Reference > Statements > Compound statements > The if statement
The if statement
The if statement is used to conditionally execute a statement or block.
IfStatement
Rule components
The expression, whose result type must be boolean, is evaluated and if its result is true the block following the then keyword is executed. After the body of the then clause has been executed, control is transferred to the next statement following the if statement.
If the expression result is false, and an else clause is present, the statement or block following the else is executed. After the body of the else clause has been executed, control is transferred to the next statement following the if statement.
If the expression result is false, and the else clause is not present, control is transferred to the next statement following the if statement.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.