Loop Activity Does Not Handle No Data
After 3 1/2 years of doing AgilePoint development, I am surprised that I had never run into this before!
I discovered that when you set up a loop in an application, if there is no data to process in the loop, the loop will still execute one time which can cause errors to occur.
For example, I have this process which does a Query Multiple activity to populate a repeating element in my process schema. I then have a loop to process the returned data:

What I found is that if the Query Multiple activity did not return any data, the loop still executed one time which then caused the process to suspend because there was no data for the steps within the loop. I guess that this occurs because the boolean variable that indicates that the loop is complete does not get set until you execute the Next Loop activity?
To avoid the error, I had to modify my process to check for the presence of data before I initiate the loop like this:

I was curious if others have run into this and if this is expected behavior?
It also got me wondering: what would happen if the Next Loop activity was moved in front of the condition check? It would probably handle the No Data scenario, but I worry that it might cause the loop to not process the last record.
请先登录再写评论。
评论
1 条评论