Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Mirth Connect File Reader support (http://www.mirthcorp.com/community/forums/showthread.php?t=9012)

vasanth.v 07-09-2013 05:23 AM

Mirth Connect File Reader support
 
Hello,

Below is our scenario, please help

1. We have a database table containing a list of file paths. We created a channel whose source is a Database reader. We need to create another source to read all the files from that database table and move it to another path. It is possible to create multiple sources like one database reader and one file reader. If so how can we achieve it. If not what are the other possibilities to read files whose paths are in the database.

2. Is it possible to create a file reader whose path can be changed dynamically.

3. How do I create a file reader which can read all files recursively from the inside folders.

Thanks in advance

cory_cole 07-09-2013 05:52 AM

I think your best bet would be to create JavaScript Reader that will pull from the database and move the files.

vasanth.v 07-10-2013 11:43 PM

Quote:

Originally Posted by cory_cole (Post 33491)
I think your best bet would be to create JavaScript Reader that will pull from the database and move the files.

As I am new to Mirth can you please help me on how to achieve it with some code samples?

narupley 07-11-2013 04:52 AM

Quote:

Originally Posted by vasanth.v (Post 33490)
1. We have a database table containing a list of file paths. We created a channel whose source is a Database reader. We need to create another source to read all the files from that database table and move it to another path. It is possible to create multiple sources like one database reader and one file reader. If so how can we achieve it. If not what are the other possibilities to read files whose paths are in the database.

Selecting the file paths out of the database is easy enough with a Database Reader. Once you've done that, just iterate through the paths in a transformer, and use FileUtils to do whatever you need to.

Quote:

Originally Posted by vasanth.v (Post 33490)
2. Is it possible to create a file reader whose path can be changed dynamically.

It is; you can use Velocity template variables in the File Reader directory field. However that takes effect only when the channel is deployed, not for each polling window. If you need to use a different directory for every poll, you can use a JavaScript Reader instead.

Quote:

Originally Posted by vasanth.v (Post 33490)
3. How do I create a file reader which can read all files recursively from the inside folders.

This has been added in 3.0: MIRTH-1441. In 2.x, you would have to use a JavaScript Reader instead.


All times are GMT -8. The time now is 06:41 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation