Extract Context Properties But ...

Hi all, is there a similar node like the Extract Context Properties but with a more granular extraction ability? I am looking for a way to extract the absolute path of any data file created when a node is successfully executed. What I then would like to do is to use this path info as a variable to let a reader node know where to find the file to read.

Thanks!

Hi @badger101

In it’s most basic form, I would opt to create a flow variable output for the writer nodes and feed that into the reader directly.

Let’s say I have an Excel Writer. I create a variable which stores the set output location (which I manually typed in this time).

Connect the flow variable port of the writer to the Excel Reader and the variable becomes available there to be used as input location.

Is this something you’re looking for or am I misunderstanding you?

Thanks @ArjenEX , can you share what’s the content of the Table Creator in your example?

Update: It’s okay, I think you were just using it as a dummy data to feed the Excel Writer.

It’s tucked away in the corner of the second screenshot, there is absolutely nothing in there :rofl:

image

1 Like

I can see how the Excel Writer’s configuration window makes it a solvable issue. But in my case, I need my Network Reader Node to read the network file produced by the Row to Network Node. My thought is to use the Network Writer to create a new file based on the file from the Network Reader, with the hope that this new file created will remain in the workflow if there’s something wrong with the original network file. (This is theoretically doable since I can set a new path in the Network Writer which will be the backup destination folder that can be accessed by the downstream nodes).

On top of all this, my workflow needs to be fully automated.

I figured your use case would be a little bit more complex. I don’t have any experience with the networking nodes so don’t know how they behave unfortunately.

1 Like

That’s okay thanks for attempting to help! I don’t expect to get lots of replies, unfortunately, since it’s weekend.

@badger101 how would this network path be defined? You can extract all variables that have been set in a node (give a variable name in the white box to the right) and use them later.

In your case you might split the path/URL to get the parent folder.

If you are dealing with remote file systems sometimes a little experimentation is needed to switch between absolute and relative paths.

In the long run you might benefit from mastering KNIME’s file path concept :grinning: instead of URLs or URIs.

Maybe you can share some screenshots about how your path and setup does look like.

1 Like

Hi @mlauber71 , thank you, the ‘CSV Chunk Write file’ workflow fits the version of workaround I’m looking for. Unfortunately, it relies on the row to variable node which can neither be linked to the Row to Network Node nor can it take in a Network file format with it.

Here’s a dummy workflow to give you the general idea of what I’m after.

Of Network & File Backup.knwf (54.5 KB)

Note that the Row to Network Node combines all subgraphs together, hence there is no need for Chunk Loops.

I have peeked at the other workflow you shared, but I’m afraid it’s too complex for me to comprehend. But I am hoping that with my dummy workflow shared here, you could have a look at a possible workaround.

If you are dealing with remote file systems sometimes a little experimentation is needed to switch between absolute and relative paths.

I only work around local file systems.

Much appreciated!

Maybe you can share some screenshots about how your path and setup does look like.

D:\Workstation Software\backup knime\Twitter API 1 Part 2 Only (Latest Version)\Analysis of (#738)\Tweet n_gram (#729)\Row To Network (#598)\internal\net_0\network\data\network.knet

@mlauber71 Here’s the additional info. Is this sufficient?

@badger101 to be completely honest I have no idea what you want to do with your workflow :slight_smile: - one part I could identify was to scan the saved workflow for existing .knet files (if this does make any sense at all you would have to decide).

In all my suggestion would be to go back to the drawing board and define what you want to do, whether it is CSV files or network files and what that has to do with temporary folders (whose location you could extract).

2 Likes

Thank you for the attempt @mlauber71 . I didn’t include the Save Workflow Node in my workflow, so maybe that’s why you mentioned “temporary folders” since you assumed I was trying to extract the destination source from a temporary folder.

But since the last workflow you shared has that node, it’s on the right track already. It has the right idea that I am locating the network file from a saved workflow.

With regards to the type of files, let me reiterate this:

So, the approach you shared in the last workflow makes sense, since it provides a bridge between the Row to Network Node and the Network Reader.

1 Like

I have tested the workflow, and with some modifications, I am able to create a copy of the file I want in a new destination folder.

Thank you. I am marking it as a ‘solution’.

My wish for this was to find a workaround while waiting for this bug to be fixed. But unfortunately even with this workaround, re-opening a saved workflow still resets every downstream nodes. I guess waiting for the bug to be fixed is all I can do at this point in time.

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