Tuesday, January 15, 2013

Writing into another channel(One channel output as a another channel's input) in Mirth

  1. Create a new channel with a name Channel1.
  2. Set data types to delimited text.
  3. Goto source tab, choose channel reader from the connector type dropdown.
  4. Goto destination tab , choose channel Writer(Because we are providing this channel output as an input for the another channel) from the connector type dropdown.
  5. In channel writer ,channel name as None(after created the Channel2 we give that name here).
  6. From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
  7. Save the channel.
  8. Then again go and create the new channel with the name Channel2.
  9. Set data types to delimited text.
  10. Goto source tab, choose channel reader from the connector type drop down.
  11. Goto destination tab ,from connector type choose FileWriter from drop down.
  12. Method -> File
  13. Directory -> Give your directory path(example D:/MirthTool/Output).
  14.  File Name -> Give your file name(Ex:Myfile).
  15. Append To file -> Yes. (or No,Depends on user)
  16.  From Destination mapping in right side,click and drag the Encoded data into the template field (or write ${message.encodedData}).
  17. Now save and go to Channel1 and change the channel name as Channel2  in the destination tab (As mentioned in the 5th step) .
  18. Now save and deploy both the channel .
  19. Now right click on the channel 1 from the Dashboard ,choose send message .Write something and click process message button.
  20. Now go to the given path(example D:/MirthTool/Output).There you can see the file which you named(Myfile).
  21. Open and see,there will be the text that you have wrote in the message field .

No comments:

Post a Comment