Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# 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, running 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 running 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` 10 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 running the code block but continue the loop.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.