none
Flat file debatching : how to preserve Trailer record ? RRS feed

  • Question

  • Hi all,

    When debatching flat file message like Header,Body,Trailer I know that it is possible to preserve Header record, but how to preserve Trailer record ?

    I suppose that a custom pipeline would do the job, but does anyone have a better idea ?

    Thanks


    Christophe BRANDO http://christophe.brando.free.fr
    Friday, August 19, 2011 9:03 AM

Answers

  • I was not able to debatch my message with DPS Bali solution.

    I didn't implement pipeline solution, but I finally get debatched messages with trailer by using a map with a loop functoid that transforms a record with several bodies (one header and one trailer) into several records (each record has one header, one body, one trailer). Then with FFDasm pipeline my message is debatched.


    Christophe BRANDO http://christophe.brando.free.fr
    Wednesday, August 24, 2011 12:08 PM

All replies

  • Hi,

    In this case customization is you only option and custom pipeline component is it. I think you can leverage pipeline component detailed in this codeproject article.

    HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server 2010
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Friday, August 19, 2011 9:30 AM
    Moderator
  • Do you have a tag identifier in the flat file for header body and trailer? As Steef-Jan pointed out a custom pipeline component can do the trick.

    Cheers,

    Bali

     


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Friday, August 19, 2011 9:45 AM
  • similar thread http://stackoverflow.com/questions/5721876/biztalk-how-to-preserve-the-trailer-when-debatching-a-flat-file
    Thanks, Raja MCTS BizTalk Server 2010 If this answers your question please mark it accordingly
    Friday, August 19, 2011 11:21 AM
  • Hi all,

    Thanks for your responses.

    Tag identifiers are set for header, body and trailer but FFDasm debatching doesn't preserve trailer.

    Do you think that using tag identifier do the job ?

    For the moment, I am developing a custom pipeline.


    Christophe BRANDO http://christophe.brando.free.fr
    Friday, August 19, 2011 12:05 PM
  • Won't do it out-of-box but yes tag identifiers would make it simpler while you are doing the custom pipeline.

     

    Cheers,

    Bali


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Friday, August 19, 2011 12:19 PM
  • I wrote 3 XSD representing Header, Body and Trailer.

    Set tag identifier for each of them.

    Configured FFDasm with HeaderSpecName, DocumentSpecName and TrailerSpecName with previously created XSD.

    Set PreserveHeader property to true.

    A message containing 3 body records is debatched into 3 messages and each of the generated messages contains header and one body BUT no trailer record.

    DPS Bali, how do tag identifiers would make the detbaching process with trailer record ?


    Christophe BRANDO http://christophe.brando.free.fr
    Friday, August 19, 2011 12:41 PM
  • I had this problem with a flat file.  I was able to get the trailer record to be parsed in just like any other line in the file, and published to the messagebox as one of the debatched records.  Promoted the first field in the record, and had filters to route the trailer record to one orchestration, and all of the others to another. 

     

    This only works if you can have your schema accept it as a record, so you either add optional fields on the end (if the trailer is longer), or make some fields in your regular record optional (if it is shorter). 

    An alternate trick I considered was to have some restriction on the table I was writing the debatched records to that wouldn't let the trailer record get written. That would make the message suspend, and I could do failed message routing to pick it up. Not an elegant solution, but one that uses out of the box functionality. 

     

     


    Down there somewhere, its just ones and zeros.
    Monday, August 22, 2011 7:41 PM
  • If you have tag identifiers for the all three header body and trailer, then consider the trailer as a part of the body and dont do a seperate schema for the trailer. Try this out and see if you get the trailer with all the body messages.

    Cheers,

    Bali


    --------------------------------------
    Mark As Answer or Vote As Helpful if this helps.
    Tuesday, August 23, 2011 2:43 AM
  • I was not able to debatch my message with DPS Bali solution.

    I didn't implement pipeline solution, but I finally get debatched messages with trailer by using a map with a loop functoid that transforms a record with several bodies (one header and one trailer) into several records (each record has one header, one body, one trailer). Then with FFDasm pipeline my message is debatched.


    Christophe BRANDO http://christophe.brando.free.fr
    Wednesday, August 24, 2011 12:08 PM
  • Hi Christope Brando,

     Even I am facing the same issue and I dont want to implement Custom Pipeline. Can you please provide me the steps to get the output? Though I am using Looping functiod I am not able to get the output. Can you please provide the source and destination schema structure to be used and way to implement?


    I know it is old post, but I am new to biztalk. so please help me with this.
    Thursday, June 6, 2013 5:48 AM