Forum Discussion
hi j.evegelvski, sorry for delayed reply.
I think I sussed it now.
!$.isEmpty() although no errors syntactically on setting it in the expression validation, it doesn’t seem to functionally work.
However, $.isEmpty() == false, the more explicit syntax, does work, therefore the router flow now conforms as expected.
Thanks for your assistance!
Glad that it is working now. But the reason why !$.isEmpty()
doesn’t work it’s because:
- When the input is empty -
{}
, the expression!$.isEmpty()
will return false because you are checking first if the input is empty ( which is true ) but you are making it false ( with the!
sign ) and in the end the Router won’t output anything. It’s essentially like saying"Check if input is empty, and if it is, stop the flow of the data ( which in this case it should continue to another output instead of stopping )."
- You can also solve this with the following Router settings
The first expression will return true if the input data is not empty ( it will output the input data to the first output view ), and the second expression will simply returntrue
and will output the data on the second output view. With theFirst match
option checked, only the first expression that returns true will be evaluated to the output even if there are more expressions that return true.
- JensDeveloper4 years agoContributor II
Why should it create an issue because then you only have the files with filed data to insert right ?
I can’t follow what your saying. You mean Succes after the last oracle insert? Or what do you mean?- amit_saroha4 years agoNew Contributor III
Thank you @JensDeveloper. I think option 2 might work for me. Could you suggest how to do it, please?
- JensDeveloper4 years agoContributor II
Hi @amit.saroha ,
Below is the attachement of the pipeline. It’s a file reader with csv parser and router. Only use the csv parser and router.
Explanation CSV parer:
uncheck the checkbox ‘ignore empty stream’ - check containts headers.Router explanation.
The first expression will return true if the input data is not empty ( it will output the input data to the first output view ), and the second expression will simply returntrue
and will output the data on the second output view. With theFirst match
option checked, only the first expression that returns true will be evaluated to the output even if there are more expressions that return true.CsvFile_Validation_V1.0_2022_07_07.slp (5.1 KB)
Regards
Jens
Related Content
- 2 years ago