web stats
Mirth Community - View Single Post - Mirth Connect File Reader support
View Single Post
  #4  
Old 07-11-2013, 04:52 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

Quote:
Originally Posted by vasanth.v View Post
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 View Post
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 View Post
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.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote