Announcement

Collapse
No announcement yet.

Accessing destination variables in postprocessor?

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

  • Accessing destination variables in postprocessor?

    Hey everyone!
    I'm trying to wrestle Mirth in between two systems that work with semaphore files. I've written a postprocessor script to remove the .sem files from the source and create them in the destination folder but it's a bit of a hack as I have to repeat the folder names all over the script.

    Is there a way to access channel configuration (file writer source folder, file writer destination folder and such) from a postprocessor script or is there a more elegant way to deal with semaphores?

    Thanks in advance!

    Regards
    Dennis

  • #2
    Re:Accessing destination variables in postprocessor?

    Oooh, that sounds interesting.

    Can you post what you have so far? Maybe we can tweak that.

    Does the semaphore indicate an exclusive lock or does it indicate that all files have been written/moved and that the next application in line should begin processing them?
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      Re:Accessing destination variables in postprocessor?

      The semaphore files are created as soon as the file has been completely written to disk (the semaphore file itself is empty so the operation of creating it is rather atomic) and deleted before it's read by the receiving system. This means that you could potentially run several readers concurrently without them interfering with each other.

      What I currently have looks like this:
      Code:
      filename=$('originalFilename').replace(".hl7",".sem"«»);
      
      FileUtil.write("c:/temp/"+filename, false, ""«»);
      But I don't really like hard-coding the "c:/temp" part. I've got a file writer destination set up that points to the same directory so it would be great if I could somehow access that information and use it in the postprocessor.

      Comment


      • #4
        Re:Accessing destination variables in postprocessor?

        You should be able to add a mapping to the channel map which will make it available throughout your channel.

        Global mapping may also be appropriate depending on your needs.
        Jon Bartels

        Zen is hiring!!!!
        http://consultzen.com/careers/
        Talented healthcare IT professionals wanted. Engineers to sales to management.
        Good benefits, great working environment, genuinely interesting work.

        Comment

        Working...
        X