I want to make transfer operation when i will have certain amount of flowFile in my flowFile queue, and i make remove operation for unused File . Can remove operation cause to dissapear flowfile from my flowfile array list ? here is my code:
import org.apache.commons.io.IOUtils
import java.nio.charset.StandardCharsets
import groovy.lang.*
def flowFile=session.get();
def name=flowFile.getAttribute("realName")
def count=flowFile.getAttribute("count")
def filename=flowFile.getAttribute("filename")
def value= count as Double;
def numb=Math.round(value)
def List<FlowFile> flowFiles= new ArrayList<>();
flowFiles.add(flowFile)
if(flowFiles.size()==numb){
for(FlowFile i in flowFiles){
if(i.getAttribute("filename").substring(0,10)==name){
session.transfer(i,REL_SUCCESS);
}
}
}
else{
session.remove(flowFile);
}