EDI batching problem (per interchange) RRS feed

  • Question

  • Hi,

    I'm having a similar problem as described in:


    My orchestration receives an XML interchange (containing multiple documents), extracts each document one at a time (from the XML interchange) and submits it to MsgBox (with ToBeBatched, DestinationPartyId and EncodingType props promoted) to be picked up by the EDI batching orchestration.


    To indicate end of messages (release criteria) I use an external trigger msg. This all works fine (i.e. EDI batch produced with correct data) if only one XML inerchange is processed at a time.


    The problem is when I have multiple XML interchanges received at the same time (i.e. there will be multiple instances of my orchestration running and each will submit its docs to MsgBox for batching) - the EDI batching orchestration creates an EDI batch output with "mixed up" data from different XML interchanges!


    It makes sence since Documentation says that there's always one batching orch instance running per party (and we only have one receiver party), but we need to create an ouput EDI batch interchange per input XML interchange...


    Is there a way to do this using out of the box batching orch?


    I've tried creating my own locking mechanism (based on DB value) so that each of my orch instances uses the batching orch one at a time, but it only works half the time as some EDI batch interchanges end up having extra msgs while others having less. Also tried using correlation (get final EDI batch msg back into my orch instance) but all context properties get lost! so I don't know what context property to correlate on...


    Any ideas what else can I try?








    Monday, December 3, 2007 6:40 AM

All replies

  • As mentioned in the documentation, in R2 only one batch per party is supported. If you are using EDI receive pipeline, you can choose to preserve interchange, in which case the whole interchange is published to message box as a single message. You can read more about this here.

    Tuesday, December 4, 2007 6:21 AM
  • Thanks for your reply Agarwal.

    Yes I've read the link that you've provided, considered using an EDI receive pipeline and checked out the "Party as Interchange Sender/Ack Generation and Validation Settings/Inbound Processing Option" feature as has been suggested...

    But these options refer to Inbound EDI Interchange processing where an EDI interchange is being received and XML interchange is being produced as output. In that case the incoming msg (EDI interchange) can go through EDI receive pipeline, the party can be configured as "Party as Interchange Sender" with "Generate Interchange XML" option enabled. The result would be "One Interchange XML is generated for the entire incoming EDI Interchange" as described in the linked page.

    In my case it's the other way around. An XML interchange is being picked up as input and EDI interchange needs to be produced as output. To do this I'm configuring my party as "Party as Interchange Receiver" (has no similar to config option regarding interchanges) and using EDI Assembler component to create the final EDI interchange (raw EDI data) file.

    To summarize what my solution does once more:
    1) An XML interchange (e.g. containing 50 messages/records) is received as input into my orchestration
    2) The orchestration determines how many messages there are and loops (e.g. 50 times) calling a .NET method to extract each message (using Xpath) at a time and submit it the BatchingService orchestration
    3) At the end of the loop, an external trigger msg is sent to the BatchingService orch to tell it to stop buffering messages and create the EDI interchange (it will still be in XML format, but ready to be assembled)
    4) Another orchestration (part of my solution) subscribes to MessageBox and picks up the final EDI interchange. It then executes a Send pipeline containing EDI Assembler comp (using LoopbackAdapter port to do this) and sends the final EDI interchange (raw EDI file) via email.

    In case of XML interchange having 50 msgs, the ouput EDI interchange should have 50 UNH segments. This is only consistent if one XML interchange is processed at a time...If for example I try to process two XML interchanges at the same time (one containing 50 msgs, another 10) of the EDI files produced may contain 47 UNH segments, and the other one 13.

    Could this be a limitation in BizTalk R2 that only one EDI interchange can be created at a time (using BatchingService orch)?


    Tuesday, December 4, 2007 10:39 AM