I have a requirement where I have to do pagination to call an API.
I am calculating the number of times I have to call an API and saving this in a context variable called "count".
I want to run through each loop where my flow should run for "count" number of times.
I tried with run assertions for each loop and trying to set count in maximum exceeded limit, but it is not working.
Even I didn't find any assertions which can help in running through loop which accepts Integer.
Please help me with some idea.
Gateway Version: 9.0.0
Create a LISAProperty (say "count") at very first step of the flow, this step has to execute only once during execution.
Now decrement the count by 1 , on completion of each loop as a last step , use scripted assertion to decrement the value.
Also do check the value before updating the count and exit if it has reached to "0".
Can you please elaborate which assertion to use exactly and how can I use number in loop.
Please read below for scripted assertion:
Scripted Assertion - DevTest Solutions - 9.0 - CA Technologies Documentation
You can write Java code(other options also available) ,something as below:
Step-1: Read the value of LISAProperty 'count' into a Integer variable(requires conversion from String type to int)
Step-2: Check 'count'
If it is equal to '0' , then end the loop
If count not equal to '0', then
decriment the value by 1 and continue in loop.
Hope it helps.
Is this in relation to DevTest? If so, there's an easier way - implement a numeric counting dataset.