Question

1
Replies
115
Views
NicoleW1571 Member since 2015 13 posts
Optum
Posted: 3 years ago
Last activity: 3 years 5 months ago
Closed

Out-of-bound exception when deleting 6th item

I am having the same issue. I am iterating through a Page-List, and removing items from the Page-List, based on a Precondition. Let's say I have 8 items, in the Page-List.

The first 3 records get removed from the PageList, correctly.

The next 2 remain, correctly.

When I get to the 6th item that should be deleted, I am getting the out-of-bound exception.

I believe it is because:

1. Pega is storing in memory the total count of the original PageList.

2. As items are being removed, the Pagelist "virtually" decreases. So, the PageList has decreased from say 8 to now 5.

3. However, Pega is still maintaining the original count of the PageList

4. Then, when I am ready to do the Page-Remove, Pega still thinks I'm at a higher index, using the original Pagelist count (before items started being deleted) However, since the Pagelist is now smaller, it can't find the index, and it is throwing error that the index is out of bound.

I don't know if this is correct thinking, or how to fix it?

***Updated by Moderator: Marissa - This post was branched off of this thread***

Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn