Flow Control

The TIBCO BusinessEvents rule Language includes commands to perform conditional branching and iteration loops.

if else
The if/else command allows you to perform different tasks based on conditions.

Syntax:

   if(condition){
       code_block;
   }
   else{
       code_block;
   }
for
The for command allows you to create a loop, executing a code block until the condition you specify is false.

Syntax:

   for(initialization; continue condition; incrementor){
   code_block;
   [break;]
   [continue;]
   }

Where:

break allows you to break out of the loop.

continue allows you to stop executing the code block but continue the loop.

For example:

   for(int i=1; i<10; i=i+1){
   System.debugOut("Hello World!");
   }

This example prints "Hello World!" to debugOut ten times.

while
The while command allows you to perform one or more tasks repeatedly until a given condition becomes false.

Syntax:

while(condition){
   code_block;
   [break;]
   [continue;]
}

Where:

break allows you to break out of the loop.

continue allows you to stop executing the code block but continue the loop.