Hi,
I see different solutions to perform this:
1. If your file is supported by Stambia (Delimited/Positional, ...) you could simply perform a select on the file with a SQL Operation and check the number of results through a bind link.
For instance:
-> The caveat of this is that all the rows of the files are read
2. You could also make a little script that test the length of the file
For instance:
In this example, we are testing that the file exists, and then its length.
The script is:
File file = new File("${../filePath}$");
if (file.exists()) {
if (file.length() == 0){
__ctx__.publishVariable("~/fileStatus","EMPTY");
}
else{
__ctx__.publishVariable("~/fileStatus","NOT_EMPTY");
}
}else{
__ctx__.publishVariable("~/fileStatus","NOT_EXISTS");
}
We are using then the variable we have published to split our Process, with conditions like
"${~/fileStatus}$" == "EMPTY"
I hope this answers to your question.