How do combine Processsteps ?

#1

Hello friends, I am creating my first workflow with Knime. Now I’m at the point where I want to put some process steps together. As you can see in the picture, I have subprocesses which should be part of a complete workflow.

Step 1. Unzip XML Files
Step two. XML parsen to Excel or SQL (I know the process is not ready yet but anyway)

Could you please tell me how you would do that?
My goal at the end is to create an automated workflow that unzips data and parses XML files.

Best regards
Philipp

0 Likes

#2

Hi there @PhilippBobo,

in order to run List Files (Node 12) after Loop End (Node 10) connect them with flow variable connection. Check in this video for more on flow variables and how to do it.

Br,
Ivan

0 Likes

#3

Hey Ivan, i tried to create a flow variable but and it works but i cant really use it. Do you have an Idea why i got these Error. “WARN List Files “Location” does not exist or is not a directory” "?

The created a global flow variable here in the workflow.
Capture

These is the Output of Node 10

Then i tried to implement these flow variable into node 12 but i received these Errors.

3 4

“WARN List Files “Location” does not exist or is not a directory” "?

Do you know why ? or what could i change ?

Best regards

Philipp

0 Likes

#4

Hi there @PhilippBobo,

there are couple of things to note here. First, glad you are trying different things and learning KNIME in this process :wink:
Second, when I said to connect nodes with flow variable connection I meant on red line connecting two nodes and not creating flow variable (you do not need to have flow variable in order to connect two nodes like this). Further on, List Files node needs directory path in order to list files from that directory. Your flow variable has value Location which is not a directory so error comes from there. You do not need (global) flow variable in this case.
Third, the output of Unzip Files already contains your .xml files which you want to read into KNIME so I would connect Loop End node to Table Row to Variable Loop Start node (or directly put XML Reader after Unzip Files and have only one loop!). If necessary, and probably is in both cases, you should remove rows which do not contain .xml files using Row Filter node with some regex. Or another option (to have only .xml files) is to use URL to File Path node and then Nominal Value Row Filter node on type column :wink:

A lot is said. Give it a try and come back. If you will still have big issues I can create you an example workflow :wink:

Br,
Ivan

2 Likes

#5

Ok its working so far. Thanks

Do you have any idea why I can’t further specify xpath? For example is this my xml file and the result of parsing:

56

5

I would like to parse only the data which contain “Normal” but i dont know how ?
I tried already this:

How can i grab a list which contains just the “Normal” values ?

Thanks so far.
Philipp

0 Likes

#6

Hi @PhilippBobo,

If you want to select an element based on an attribute value you have to follow this format:
//Element[@attribute='value']

:blush:

0 Likes

#7

Hey thanks for your Advice but unfortunately it doesnt work. Any other Advice ?

`//Element[@attribute=‘value’]’ Is it in general possible to use the attribute value for an specific selection ?

0 Likes

#8

What is your desired output? And if possible, please provide a sample XML file.

1 Like

#9

Capture

0 Likes