I have several flowfiles in sucess queue in which i have parameter count and
i have to transfer only counter amount flowfiles , every time counter value
is different so any time i will have to get it from flowfile( all flowfile
from this success queue have this attribute), i have tried this logic below
( i mean my code) and several modifications of it but i can't fulfill this
task, could you tell me what's wrong with this code?

import org.apache.commons.io.IOUtils
import java.nio.charset.StandardCharsets
import groovy.lang.*
 
def flowFile= session.get();
if (!flowFile) return;
int numb=(flowFile.getAttribute("count") as Double).round()
def filename=flowFile.getAttribute("filename")
 
 
def flowfileList = session.get(numb-1)
 
if(flowfileList.size() == numb-1) {
session.transfer(flowfile,REL_SUCCESS);
session.transfer(flowfileList,REL_SUCCESS);
 
}
else{
session.rollback()
 
}



--
Sent from: http://apache-nifi-users-list.2361937.n4.nabble.com/

Reply via email to