BizTalk Server: Multiple XML files to Single FlatFile Using File Adapter - Configuring and testing

{tocify} $title={Table of Contents}





Configuring the application 



Receive Port


Receive Port

Receive Location


receive location


Send Port



send port

Send pipeline: MXSFF (Custom flat file)


Destination URI


SourceFileName




  • File name: %SourceFileName%.txt (puts the value of the FILE.ReceivedFileName)
  • Copy mode: Append (The file send handler opens a file if it exists and appends a message to the end of the file. If the file does not exist, the file send handler creates a new file)


So for example, when first message or batch of messages are received on date 10-11-2014 then new file will be created at destination location having 10-11-2014.txt and then after whatever messages are received until the end of date are appended to the same file. But a new file will be created for messages received on next day.


Configuring send pipeline (Flat file assembler)



configuring send pipeline

Configuring Orchestration


configuring orchestration


Testing the application


To test the functionality of application, considered two test cases

Testcase 1: First files of the day


Input: Placed three sample files in XMLIN folder (input location)


Place file in input location

Output: A file with today’s date was generated at FFOut (destination location)
output file


Testcase 2: Rest files of the day


Input: Placed two sample files in XMLIN folder (input location)
Output: Records were appended to the existing file
output file appended

Download Sample



If you have questions or suggestions, feel free to do in comments section below !!!


Do share if you find this helpful .......
 
                          Knowledge Sharing is Caring !!!!!!


1 Comments

If you have any suggestions or questions or want to share something then please drop a comment

  1. This is actually a very bad practice to do, the file could change, be removed/renamed, it might be different, you are basically using the file append on the adapter to do the combination of the messages. What if they want a message every hour, will you fudge the file name, there is a MUCH better way to do this...

    ReplyDelete
Previous Post Next Post