web stats
Post file reader - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2019, 05:56 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,277
cory_cole is on a distinguished road
Default Post file reader

I have a channel that reads in all of the files in a folder and process them. After it has read all the files, I need to do another step. I have tried putting the code in the destination and in the post processor but it does it for each file. Where can I put the code to run after all files are processed?
Reply With Quote
  #2  
Old 09-24-2019, 11:23 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 964
agermano is on a distinguished road
Default

If you're on a current versionof mirth, the File Reader will set a sourceMap variable 'pollComplete' with a value of true for the last file read in.

You can do in your post-processor

Code:
if ($('pollComplete')) {
    // run your clean-up code.
}
Reply With Quote
  #3  
Old 09-27-2019, 09:38 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,277
cory_cole is on a distinguished road
Default

This looks like it works. It is not doing the code for each file. I will know if it does it at the end this weekend. We had over 400,000 files to process.
Reply With Quote
  #4  
Old 09-30-2019, 08:46 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 964
agermano is on a distinguished road
Default

It should work for mirth version 3.6 or higher.
Reply With Quote
  #5  
Old 10-07-2019, 01:57 AM
JosefiinaRautakorpi JosefiinaRautakorpi is offline
What's HL7?
 
Join Date: Oct 2019
Location: Finland
Posts: 1
JosefiinaRautakorpi is on a distinguished road
Default

Minulla on versio 3.6. Kaikki toimii oikein. Yritä päivittää.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:57 PM.


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