Programmatically removing objects from an Iterator for ADF or BPM Arrays

This one took me way too long to figure out but the ADF documentation finally revealed that you should declare another iterator and use that iterator to go through the RowSet.

//Iterate Control Tests
DCBindingContainer iteratorBindings =
(DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding myIterator = iteratorBindings.findIteratorBinding(“dataControlBinding”);

RowSetIterator rsi = myIterator.getRowSetIterator();

RowSet rowSet = rsi.getRowSet();

RowSetIterator secondaryIterator = rowSet.createRowSetIterator(null);

//Remove all Existing Objects in BPM
if (rsi.getRowCount() == 1) {
System.out.println(“EXECUTING IF EQUALS 1”);
Row oneRow = rsi.getCurrentRow();

if (rsi.getRowCount() > 1) {
System.out.println(“EXECUTING IF MORE THAN 1”);
Row cycledRow = secondaryIterator.getCurrentRow();



while (secondaryIterator.hasNext()) {
System.out.println(“EXECUTING WHILE LOOP”);
System.out.println(“Inside the While Loop for Iterator”);
cycledRow =;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s