While Loop in OIC | While Action | Oracle Integration Cloud
Knowledge : 👀
While Loop? : Loop over actions or invoke connections as long as a specific condition is met. You define the condition for the while loop in the Expression Builder.
Lets understand the While Loop by the help of one Hands-on Practice. In Part 1 we will compare numbers and in Part 2 we will compare String in while loop expression builder.
PART 1 :
Compare Numbers in While Loop | Oracle Integration Cloud :
Use case : lets develop one Schedule Integration using While Loop which will keep executing till the time a specific condition is not fulfilled (for ex :- condition is While Loop will keep running till the time Variable_B value > Variable_A value). Once the condition failed, while loop execution will get end.
STEP 1: Create one Schedule Integration.
STEP 2: Add Assign activity, give some meaningful name & then declare Two Variables (ex : – var_A and var_B ). Initialize the variables by assign values 1 and 10 respectively. (as shown in below image)
- Compare the variables as shown in below image
Expression : number($var_B) > number($var_A)
STEP 4 : Now add one Assign activity inside the While Loop to keep increasing the Variable_ A value by 1 after each loop completion.
- Build the expression to keep increasing the Value of Variable A (var_A) after each iteration. (take reference from below image )
Expression : number($var_A) + 1.0
STEP 5 : Enable the Tracking Variable (you can take reference from below image )
STEP 6 : Save the Integration & Activate the Integration.
STEP 7 : TESTING : – Submit the Integration for Testing.
- Click on the Instance Id that got generated after submission to track the Flow.
You can see it clearly While Loop executed 9 times and came out the loop when condition failed (i.e when var_A value became equal to var_B value.) This way we have successfully completed one While Loop POC. I hope this helped you to understand While Loop use in Oracle Integration Cloud.
PART 2 :
Compare String in While Loop | Oracle Integration Cloud :
Note : To compare String using While Loop you can use contains function (as shown in below image ). You can’t simply compare two string in while loop expression builder. It will Error out.
Thank You !
You may also like
6 comments
Leave a Reply Cancel reply
Archives
- November 2024
- October 2024
- May 2024
- June 2023
- December 2022
- October 2022
- September 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- August 2021
- July 2021
- May 2021
- March 2021
- January 2021
- November 2020
- October 2020
- September 2020
- May 2020
- March 2020
- February 2020
- January 2020
- December 2019
- August 2019
- July 2019
- June 2019
- May 2019
- March 2019
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||








Nice explanation, Appreciate. Is it possible in For Loop ?
Thanks. No its not possible in FOR loop. But one suggestion I can give : You can use WHILE Loop Inside FOR Loop to fulfil your requirement.
how to reverse the string using while
you can try this : Inside WHILE loop, use ASSIGN activity, inside ASSIGN activity by using some STRING FUNCTION you can reverse the string
How to avoid "While loop exceeded Upper limit.
It executed 5,000 times." issue
Hi Kabir, how we can configure the for each loop where if one of the iterations throws fault, subsequent iterations continue to execute?