I want to get one flowFile (from success queue) to read count attribute from
it, and then i want to get count number flowfiles and put it in flowfile
List after that i will check if flowfile list size == count i will transfer
all receveied flowfiles I have tried codes like this, but this logic doesn't
work for me should i use wait/notify processor or routeonattribute
processor? can you give me any alternative idea of how can i make this task?
import org.apache.commons.io.IOUtils
import java.nio.charset.StandardCharsets
def flowFile = session.get()
if (!flowFile) return
int numb=(flowFile.getAttribute("count") as Double).round()
int m=numb;
session.rollback();
def flowFiles = session.get(m)
if (flowFiles.size()==m){
//transfer first and other files to success
session.transfer(flowFiles, REL_SUCCESS)
}else{
//rollback everything we got from incoming queue
session.rollback()
}
--
Sent from: http://apache-nifi-users-list.2361937.n4.nabble.com/