Skip to main content
Hello:

 

 

Is there any way to take the results of a writer and use them within a second reader (within the same workbench) ?

 

 

I have this scenario:

 

 

Reader_1 - Transformers - Writer_1

 

 

Reader_2 - Transformers - Writer_2

 

 

Is there any way that Reader_2 can read the results produced by Writer_1 within the same workbench?

 

 

Thanks, 
Hi,

 

 

I think there is no way to read the result dataset which will be written in the same workspace. Doesn't connecting directly the second process to the first process help you?   Reader_1 --> Transformers (first process) * * --> Writer_1 * --> Transformers (second process) --> Writer_2
Hi again Takashi: That was my first bet but unfortunately it does not work, because still both readers seem to start at the same time regardless of the connection created between the processes. Thanks again and regards, Richard.
Hi Richard,

 

 

you will have to use two workspaces to accomplish this.

 

 

Have a look at the answer (Python shutdown script) I gave you here, it shows you how it can be done.

 

 

Tested like this:

 

  • workspace1 creates a shapefile
  • workspace1 shutdown script executes workspace2 with its output shapefile as input parameter to workspace2
  • workspace2 does its thing on the same shapefile
Hope this helps.

 

 

David
Richard,

 

Looking at your recent posts it seems you are trying to load data into at least two tables where there is a constraint built between them. Correct me if I'm wrong. Therefore I assume you are trying to ensure the table with the key for the constraint is loaded first. There are other ways of achieving this without the need for multiple workbenches.

 

You could use two writers for the same format in the same Workbench but control the order of the Writers to ensure the correct order is maintained. Downside is that the data for the second table would need to reside in memory until the first table had finished writing. OK if not too many records.

 

This link talks about performance but could be used what I describe above.

 

https://knowledge.safe.com/articles/44349/writers-and-performance.html

 


Thank you all.

 

 

@David: I will try that option. Unfortunately, being new in this FME world, I am still discovering several transformers, learning a bit of Python and getting familiar with all the options available.

 

 

@Mark: I have bypassed the processing of the two tables with a constraint. What I am trying to achieve now is to load the data into those two tables and then load the product of joining those two into what is called "a static view", which is a table with the contents (no, is not a spatial view, materialized view or a view).

 

 

We would like all this to happen on the same workbench and the load of this "static view" has to be done from the tables written by Writer_1, and not the original data sources.

 

 

Thanks very much to all.

 

 

Regards,

 

 

Richard.
My 2c is that I think there is a way to do this, but I'm not totally clear on the scenario.

 

 

You say:

 

 

What I am trying to achieve now is to load the data into those two tables and then load the product of joining those two into what is called "a static view"

 

 

Unless there is something special that happens in those two tables (ie the database itself changes the data in some way) then you already have the information within the workspace. Why do you need to read back what you are already writing?

 

 

Could you not just draw a second connection to the Static View - maybe going through a FeatureMerger transformer if necessary to merge the data.

 

 

 

 

The InlineQuerier transformer may also be of use there.

 

 

But, failing that, for a database, you could use a SQLExecutor instead of a writer, to load the data into the output tables. Then use a FeatureReader transformer to read it back. But - as above - it just seems to me that you're writing data and reading it back again for no reason.

 

 

NB: I think at some point we'll create a FeatureWriter transformer, so you can write data mid-translation in this way, but for now only a few transformers will write like that (SQLExecutor and AttributeFileWriter,  with help from the GeometryReplacer)

 

 

Hope this helps

 

 

Mark

 

 

Mark Ireland

 

Product Evengelist,

 

Safe Software Inc.
Hi Mark.

 

 

It would be VERY nice if you could add an OUTPUT port on any WRITER. This would solve some issues running multiple workspaces creating different files and trying to do the same thing on FME Server. Often I want to update a database, and depending on the failure/success generate some additional files to send to the user.

 

 

Have you estimated the size of the task (S-M-L-XL) ? To restructure FME to have an OUTPUT port on any WRITER?

Hi @canpernano

please take a look at FeatureWriter and FeatureReader - these two transformers might be exactly what you need for your workflow.


Hi @canpernano

please take a look at FeatureWriter and FeatureReader - these two transformers might be exactly what you need for your workflow.

Perfect @LenaAtSafe. The transformer FeatureWriter after FeatureReader are the revolution of FME :)

 


Reply