Announcement

Collapse
No announcement yet.

Post file reader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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.
    }

    Comment


    • #3
      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.

      Comment


      • #4
        It should work for mirth version 3.6 or higher.

        Comment


        • #5
          Minulla on versio 3.6. Kaikki toimii oikein. Yritä päivittää.

          Comment


          • #6
            Be careful about the implementation. I think to do what you want to do (had something similar to do recently), you need to check this:

            Code:
            $('pollComplete') == true && $('batchComplete') == true
            Checking the combined values was ultimately the only thing that produced a consistent boolean value for post-processing behavior.

            Comment


            • #7
              Originally posted by jonathanlent View Post
              Be careful about the implementation. I think to do what you want to do (had something similar to do recently), you need to check this:

              Code:
              $('pollComplete') == true && $('batchComplete') == true
              Checking the combined values was ultimately the only thing that produced a consistent boolean value for post-processing behavior.
              Good point!

              Comment

              Working...
              X