Home > BizTalk, BizTalk EDI > Batching Outbound EDI messages in BizTalk Server 2009

Batching Outbound EDI messages in BizTalk Server 2009

While working on a B2B projects, it is very common requirement to send many EDI documents at once within a single batch. From BizTalk 2006 R2 onwards we have native EDI support in BizTalk, therefore no need to use any accelerators.
We have got following components in BizTalk to accomplish batching outbound EDI messages.
        • BatchMarkerReceivePipelineComponent in the EDI receive pipeline
        • Routing Orchestration
        • Batching Orchestration
        • Upgrade Batching Orchestration
        • BatchSuspend Orchestration
        • EDI Send Pipeline
These components are installed as DLLs when we install and configure BizTalk Server EDI and AS2 and available under the “BizTalk EDI Application”.
Please refer MSDN,to have more details about EDI batching in BizTalk .

In this blog, I am going to demostrate step by step tutorial on how to implement batching outbound EDI transactions in BizTalk Server 2009.

Steps:

1. Open Visual Studio 2008 and create a BizTalk project named “Abhijit.BizTalk.EDI”.

Solution

2.Right click on the BizTalk project created and click on add existing items , browse to the folders “C:\Program Files\Microsoft BizTalk Server 2009\XSD_Schema\EDI\X120501” and select the invoice schema “X12_00501_810.xsd”.

3.Go to the project properties, sign the assembly and deploy the project to the application “Abhijit.BizTalk.EDI”.
proj1

proj2

4.Close the Visual studio and open the BizTalk Server Administrator console.

5.Right click on “Abhijit.BizTalk.EDI” application, Click on Add–>References.

AddRef

6.Select the “BizTalk EDI Application” and press OK to add the reference.

AddRef2

7.Create a new Receive Port and new receive location and set the following:
           Name of the ReceivePort : RcvInvoice
           Name of the ReceiveLocation: RcvLoc-Invoice
           Type of the RecieveLocation : FILE
           Receive Folder : <<file directory where receive location listens for incoming files>>
           Receive Pipeline : EDIReceive

 
RcvLoc

RcvLoc1

8.Now create a new party named “TestBatch” and set the EDI Properties as shown in the below images.
EDI

EDI

EDI

EDI

9. Now Select Batches–>Click on New Batch button
        Click on Filter and set the filter property as
                 BTS.ReceivePortName == RcvInvoice
         Click OK to save the filter settings.
EDI

Select the Maximum Number of Transaction Sets property and set the Interchange property to 3. This will make that a batch file will send out only when three documents are available in the BizTalk message box.
Click on the Start button to start the batching.

10. Now create a new send port and set the following properties:
                   Name of the Send Port : SndBatchInvoice
                   Type : FILE
                   Send Folder: <<Destination File location>>
                   Send Pipeline : EDISend
          Filters:
                  EDI.DestinationPartyName ==TestBatch
                  EDI.ToBeBatched == False
   Click OK to save the send port settings.

EDI

EDI

11. Now associate the send port with the party , From the Parties, Right click on the “TestBatch” party and set the send ports as shown in below image.

Party

12. Start the batching orchestrations:
            

              a. Click the BizTalk EDI application.Start all three of the batching orchestrations (shown in below image).

EDI

13.  Enable the Receive location (RcvLoc-Invoice) and Start the send port(SndBatchInvoice).

Test the solution:

    a. Drop the sample file Invoice5010.txt from in the receive location folder.

EDI

         b. Drop the same file another two times in the same receive location folder.

         c. Check the output folder. You can see a single batch file containing three files, as shown in below image.

EDI

Download the SourceCode:

To download the code please Click here

Note:Change the extension of the file from .doc to .zip and extract it into your C: drive.

Advertisements
Categories: BizTalk, BizTalk EDI
  1. Paul Sch.
    March 17, 2011 at 1:20 pm

    I need to batch EANCOM messasges, it’s nearly the same thing as X12 except segment definition.
    I do it the first time, and i’ve never seen any running EDI BTS Application with batching before.

    Very nice clearly written step by step instruction! Great help for me!
    Abhijit, thanks a lot!

    • March 17, 2011 at 6:23 pm

      Dear Paul,

      Thanks for your comments. I am really very happy to hear that my post helped you to solve your problem.These days I am quite busy with my project deliverables, so didn’t get time to write new post. Your comments would really motivate me to write new post very soon.

      Regards,
      Abhijit

  2. March 30, 2011 at 3:27 pm

    Very helpful information. Thank you for sharing!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: