Apama 10.15.0 | Developing Apama Applications | EPL Reference | Statements | Compound statements | The switch statement
 
The switch statement
The switch statement is used to conditionally execute a block of code based on the type of an any expression. Unlike the if and if ... else statements, the switch statement can have a number of possible execution paths.
Syntax diagram for switch statement
The switch statement names the expression as an identifier with the as keyword followed by an identifier to name the value. In each case clause block, the identifier has the same type as the case clause.
If the expression is a simple identifier (that is, it is referring to a variable or parameter), then the as Identifier part can be omitted. The new local retains the same name.
For more details, see Handling any values of different types with the switch statement.