If switch condition when an exception is logged in a log file

Hi all,

daily Business: reading log files from a network share and transforming an converting them to a table. This works fine but… in some cases the useres who created the log file cancel the log file process. In this case in the log file there is a line at the end of the file like this:

#EXCEPTION: User canceled script!

With the rule engine node I find this line and I create a “cancel” in a nwe column. But now I “standing on the hose”. I used a tabel row to variable node to create a flow variable switch for the IF switch node but the ports ar Always open because the “cancel” out from the rule engine node is at the ende of the column? How Can I fix this Problem only if a “cancel” is detected in the specific column use the bottom output port of the IF switch. If it is not detected use the top Output port.
I also tryed to use a empty table switch node. This is a quite good idea but when no “cancel” is created the row filter node in front of the empty table switch makes a empty table an all the data I want to process is gone. See attached a screenshot of my workflow.

Thx for any ideas, Brotfahrer

Hi @Brotfahrer,

Add a column filter at red (or any other data node)
Connect CSV Reader direcly to your processing - green
Disconnect connection from switch - blue
Add a colum filter without filter in green and connect them via flow variable - yellow

So basically something like this:
KNIME_project12.knwf (18.7 KB)

3 Likes

Hi @AnotherFraudUser,

thx for your Response. In my case the first time I’ve the Information if the exception is logged is at the Output of the CSV Reader node.

In my understanding to put the CSV Reader node between the switches the Information About the exception ist “too late”, isn’t it?

Brotfahrer

Hi @AnotherFraudUser

I got it :smiley: This workflow works fine for me

Thanks for the tricke with the flow variable Connection and the dummy column filter nodes.

Greetings, Brotfahrer

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.