Wednesday, 27 February 2013

EDI Batching using Biztalk Server 2010



This document describes how to batch multiple EDI document into single interchange EDI.

EDI Batching in Biztalk is done using Batching orchestration(Microsoft.BizTalk.Edi.BatchingOrchestration.BatchingService) that is shipped with Biztalk. This batching orchestration is directly binded with MessageBox and picks up message with EDI.ToBeBatched=True. This flag is set when the message is received using edi receive pipeline. There is a component called "BatchMarker" in the receive pipeline that promotes and sets "EDI.ToBeBatched=True".

 Example of Interchange with multiple EDI 840 Transaction.















1: Create Receive Pipeline “EDIBatchMarkPipeline” which will mark edi document for EDI Batch.
  •  Create receive pipeline
  • Add EDI Disassembler, add Batch Marker component.

2: Create receive port “EDIBatchMarkPortFor840”and receive location with EDIBatchMarkPipeline.
Example of EDI 840 with single transaction for batching.

ISA*00*          *00*          *ZZ*US             *ZZ*THEM           *130227*0057*U*00401*000000020*0*T*:~
GS*RQ*BTS-SENDER*RECEIVE-APP*130227*0057*20*T*00401~
ST*840*0020~
BQT*00*BQT02*20111204*001*20120103~
PER*1A*Firstname1**Lastname1~
N1*01~
N2*C01~
N3*Line11*Line21~
N4*City1*WA*112*US~
PO1**1**1***1~
SE*9*0020~
GE*1*20~
IEA*1*000000020~

3: Create Batch configuration for batching.

4: Create two parties: ThemPartyFor840, UsPartyFor840

5: Create agreement for two parties name Agreement1.

6: Create identifier settings.















7: Create batch configuration for UsPartyFor840à ThemPartyFor840


 













Filter Expression
BTS.ReceivePortName = EDIBatchMarkPortFor840
BTS.MessageType= http://schemas.microsoft.com/BizTalk/EDI/X12/2006#X12_00401_840

8: Click on start batch, after click on start batch, Orchestration (Microsoft.BizTalk.Edi.BatchingOrchestration.BatchingService) Instance is created in admin console.



When you click on start button in batch configuration, an entry has been created in PAM_Control table
NOTE : BatchingService orchestration monitor PAM_Control table using sql adapter, as entry comes into table , instance of orchestration start to pick EDI  message whose EDI.tobeBatched context property is true.


9: Create Send port with Filter Expression:
EDI.ToBeBatched == False And
EDI.BatchName == Batch1

10: Start Receiveport , sendport and batch,

11: drop multiple EDI 840 to receive location, check output location.

No comments:

Post a Comment