In my workflow I have 2 List files nodes processing , the first 1 List files nodes is reads from the folders and processes the files data using Java snippet node and places the processed files into another directory . The second node list files node has to read from the files from the processed folder and the renames the files based on the certain rules. Java snippet appears exhibit async behaviour , it immediately passes control to next List files node , which finds no files in the processed folder and fails execution . I have used wait node , but it is not the best , as we can either set specific wait time or to lookup specific file , which is not useful for me.
Appreciate inputs on how can I control subsequent node execution , until the earlier node processing is complete . The List files node does not have input port , is also constraining in the flow . I have tried using flow variable from earlier node , but it doesnt help .