Good day
I am fairly new to Apache Nifi and I have my difficulties with some basic logic (although I once worked as software dev) within Nifi. As far as I understood, Nifi's flow files are always one "physical" file (payload/content) with its meta data (attributes).
How can I guarantee, that a file pair (two files belonging to each other) get copied to another location in a defined order?
The situation is the following:
System B has a folder listener which further processes the xml+pdf and will cause errors if the xml is there before the pdf - this part cant be changed
My current approach is not working, I understand why, but I cant find a solution on how to solve my problem with the corresponding files.
${absolute.path}/${filename}
)${absolute.path}/${filename:substringBeforeLast('.'):append('.pdf')}
)
${filename:toLower():endsWith('pdf')}
) <-- here it fails, file is xml${absolute.path}/${filename}
)${filename:toLower():endsWith('xml')}
)Long story short. I believe I am doing this completely wrong and I am in need of some advice (not the solution ;) )
Why are you fetching the xml file first ? If you want to move your files only when the pdf is here, you just have to check when the pdf appears, and then move your files.
You could do the following :