none
Extract InterchangeSequenceNumber from a batched EDIFACT message in a pipeline component RRS feed

  • Question

  • Hi all,

    I’m trying to find a way to extract the individual EDIFACT InterchangeSequenceNumber value in a batched EDIFACT SalesOrder.

    I´m using a BizTalk 2009 server.

    My receive pipeline contains the following components.

    Step 1: Custom component which saves the original message as a string in a database. The component creates a tracking ID (GUID) which is promoted to a custom property schema.

    Step 2: EDI Receive component. The BizTalk party option "Inbound batch processing option" is configured to "Split interchanges as Transaction Sets – suspend Transactions Sets on Error"

    Step 3: Custom component, Saves the InterchangeMessageXMLPart and all EDIFACT references (InterchangeID, Sender, Receiver..) Uses the tracking ID created tracking id created in Step 1 to update the correct record.

    My problem is that I’m unable to extract the EDIFACT InterchangeSequenceNumber in step 3 of my pipeline. When I check the messages context values, the InterchangeSequenceNumber is set as "Not Promoted"

    Any help or suggestions will be appreciated.

    Best Regards

    Rasmus Jaeger

    Tuesday, March 1, 2011 3:20 PM

Answers

  • Dear Mr. Rasmus Jaeger

    The reason why you cannot extract InterchangeSequenceNumber is because it does not exist in context as this point. Because of the streaming behavoiur mechanisms in BizTalk pipelines, allthough your edifact dissassembler has already been invoked the actual disassembling has not yet been processed.

    The correct way to do this would be to hook up on the readevent as well, and then do the context extraction. The "hack" ofc. is to read the stream in the validate stage which will trigger the disassembler to be executed, thus writing your property to context.

    Friday, March 4, 2011 10:30 AM

All replies

  • Dear Mr. Rasmus Jaeger

    The reason why you cannot extract InterchangeSequenceNumber is because it does not exist in context as this point. Because of the streaming behavoiur mechanisms in BizTalk pipelines, allthough your edifact dissassembler has already been invoked the actual disassembling has not yet been processed.

    The correct way to do this would be to hook up on the readevent as well, and then do the context extraction. The "hack" ofc. is to read the stream in the validate stage which will trigger the disassembler to be executed, thus writing your property to context.

    Friday, March 4, 2011 10:30 AM
  • Hi Thomas,

     My step 3 is already in the validate stage, but the value is still not promoted.

     All context values from the Validation stage:

     FileCreationTime http://schemas.microsoft.com/BizTalk/2003/file-properties 08-03-2011 07:38:25
    ReceivedFileName http://schemas.microsoft.com/BizTalk/2003/file-properties C:\FileDrop\EDI\IN\12100.edi
    ActivityIdentity http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties {5DD87B8F-10B8-4493-BE01-D41BF1A636B9}
    AdapterReceiveCompleteTime http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties 08-03-2011 07:38:25
    PortName http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties ReceiveEDIFromTradingPartnerPort
    InboundTransportLocation http://schemas.microsoft.com/BizTalk/2003/system-properties C:\FileDrop\EDI\IN\*Copy*
    InterchangeID http://schemas.microsoft.com/BizTalk/2003/system-properties {B8500A34-E647-4218-938F-BAF826E5B468}
    ReceiveInstanceID http://schemas.microsoft.com/BizTalk/2003/system-properties {73FA476D-D3E1-4BF4-B43F-4CE82F71FAE8}
    ReceiveLocationName http://schemas.microsoft.com/BizTalk/2003/system-properties ReceiveEDIFromTradingPartnerPortLocation
    ReceivePortID http://schemas.microsoft.com/BizTalk/2003/system-properties {A7ADC224-627D-44D8-B825-B63E17EB67A2}
    ReceivePortName http://schemas.microsoft.com/BizTalk/2003/system-properties ReceiveEDIFromTradingPartnerPort
    AuthenticationRequiredOnReceivePort http://schemas.microsoft.com/BizTalk/2003/system-properties False
    InboundTransportType http://schemas.microsoft.com/BizTalk/2003/system-properties FILE
    LRPMsgBodyTracking http://schemas.microsoft.com/BizTalk/2003/system-properties 48
    MessageExchangePattern http://schemas.microsoft.com/BizTalk/2003/system-properties 1
    ReceivePipelineID http://schemas.microsoft.com/BizTalk/2003/system-properties {D4FF02B1-373A-4A2E-B537-8DE44E3A1583}
    ReceivePortAuth http://schemas.microsoft.com/BizTalk/2003/system-properties 0
    ReceivePipelineConfig http://schemas.microsoft.com/BizTalk/2003/system-properties <Root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Stages><Stage CategoryId="9d0e4103-4cce-4536-83fa-4a5040674ad6"><Components><Component Name="BizTalk.Common.PipelineComponents.TrackInboundEDIFACT"><Properties /></Component></Components></Stage><Stage CategoryId="9d0e4105-4cce-4536-83fa-4a5040674ad6"><Components><Component Name="Microsoft.BizTalk.Edi.Pipelines.EdiDisassembler"><Properties><CharacterSet vt="8">ISO-8859-1</CharacterSet></Properties></Component></Components></Stage></Stages></Root>
    SuspendMessageOnRoutingFailure http://schemas.microsoft.com/BizTalk/2003/system-properties True
    MessageType http://schemas.microsoft.com/BizTalk/2003/system-properties

    http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006#EFACT_D96A_ORDERS_EAN008
    UNB2_1 http://schemas.microsoft.com/Edi/PropertySchema 5790000000xxx
    UNB2_2 http://schemas.microsoft.com/Edi/PropertySchema 14
    UNB3_1 http://schemas.microsoft.com/Edi/PropertySchema 5790000000xxx
    UNB3_2 http://schemas.microsoft.com/Edi/PropertySchema 14
    UNB11 http://schemas.microsoft.com/Edi/PropertySchema 0
    UNH2_1 http://schemas.microsoft.com/Edi/PropertySchema ORDERS
    UNH2_2 http://schemas.microsoft.com/Edi/PropertySchema D
    UNH2_3 http://schemas.microsoft.com/Edi/PropertySchema 96A
    UNB_Segment http://schemas.microsoft.com/Edi/PropertySchema UNB+UNOC:3+5790000000xxx:14:+5790000000xxx:14+080905:1203+KH249120342619+################+ORDERS++0++0'
    UNA_Segment http://schemas.microsoft.com/Edi/PropertySchema UNA:+.? '
    ReuseEnvelope http://schemas.microsoft.com/Edi/PropertySchema False
    SourcePartyID http://schemas.microsoft.com/BizTalk/2003/system-properties S-1-9-893551331-2747879358-2265075479-3534360612-2680644325-2751941009-2517048791-3831030182
    PartyName http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties 20401001

    My current workaround is to add my tracking component to my sendport.

     

    Thanks for your reply

     

    Best regards

    Rasmus Jaeger

    Tuesday, March 8, 2011 7:49 AM